29.01.2013 Views

WebSphere Application Server - IBM Redbooks

WebSphere Application Server - IBM Redbooks

WebSphere Application Server - IBM Redbooks

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Figure 7-17 <strong>WebSphere</strong> extensions<br />

7.3 Using servlets in the Online Catalog sample<br />

To illustrate the creation of a servlet using Studio Site Developer we will start the<br />

process of creating an administration login function for our site using servlets.<br />

The entire process of the login function will not be illustrated here.<br />

Important: If you are downloading the Online Catalog sample from the<br />

additional material section of the Redbook site, it will not have the servlet login<br />

process linked up. The servlet in this example (along with other servlets) will<br />

be located in the common package. Any JSPs or HTML pages associated with<br />

the example will be located in the servlet_login folder in the WebContent<br />

directory.<br />

The login function in the sample will use a JSP to verify that the username and<br />

password submitted are valid by referencing a table in the SALESAPP<br />

database.<br />

The first step in the login process is login.html. This page collects the user name<br />

and password from the user and passes control to LoginServlet. LoginServlet<br />

captures the user name and password from the login.html form, verifies them<br />

using additional database connection wizards, and then forwards the user to the<br />

site administration selection page; admin.html.<br />

232 <strong>IBM</strong> <strong>WebSphere</strong> <strong>Application</strong> <strong>Server</strong> - Express V5.0.2 Developer Handbook

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

Saved successfully!

Ooh no, something went wrong!