29.01.2013 Views

WebSphere Application Server - IBM Redbooks

WebSphere Application Server - IBM Redbooks

WebSphere Application Server - IBM Redbooks

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Struts login<br />

Depending on the user name and password submitted, the user will see a<br />

different administrative maintenance page. The “read access” administrator<br />

(admin1) will see options to view customers and orders. The “write access”<br />

administrator (admin2) will see the options to view, edit, and delete products.<br />

Struts will be used to first validate the user name and password entries and then,<br />

depending on the submitted values, the action will forward the user to the<br />

appropriate page. A Struts action will also be used to log the user out of the<br />

administrative section of the site.<br />

LoginAction.java<br />

Figure C-11 Web diagram of Struts login component<br />

The table below lists the main files involved in this portion of the application.<br />

Table C-12 Struts login items<br />

LoginForm.java<br />

Item Folder/Package Description<br />

LogoutAction.java<br />

login.jsp struts_login Provides the interface to login to<br />

the administration page.<br />

admin1.jsp struts_login Displays the options to view a<br />

customer or an order.<br />

admin2.sjp struts_login Displays the options to view, edit,<br />

and delete products.<br />

Appendix C. Online Catalog application 631

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!