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.

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

additional material section of the <strong>IBM</strong> Redbook site, this sample will be<br />

included in the project but will not be incorporated into the application. The<br />

classes created in this example will be located in the onlinecatalog.actions<br />

and onlinecatalog.forms packages. Any JSPs or HTML pages associated with<br />

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

directory.<br />

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

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

database.<br />

12.3.1 Adding Struts support to the OnlineCatalog project<br />

When we originally created the OnlineCatalog project, we did not add Struts<br />

support. In order for us to continue, we need to enable Struts support on the<br />

project.<br />

1. In the Project Navigator view of the Web Perspective, right-click the<br />

OnlineCatalog Web project and select Properties from the context menu.<br />

2. Select Web Project Features from the left menu box to display the Web<br />

Project Features in the dialog.<br />

3. Select the Add Struts support check box from the features list box.<br />

4. Click Apply. The Struts Settings page is displayed. This page allows you to<br />

override the default Struts settings; see “Enabling Struts support in an existing<br />

project” on page 391 for more information.<br />

5. Click Finish to update the project properties with Struts support.<br />

6. Click OK to close the project properties dialog.<br />

12.3.2 Creating a Web diagram<br />

Now that Struts support has been added to the OnlineCatalog project, we can<br />

create a Web diagram.<br />

1. In the Project Navigator view, navigate to the<br />

OnlineCatalog\WebContent\struts_login folder.<br />

Chapter 12. Using Struts 427

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

Saved successfully!

Ooh no, something went wrong!