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.

inforequest.html mailer.jsp<br />

.<br />

.<br />

.<br />

Figure 9-11 Example process<br />

We will assume at this point that the inforequest.html page has already been<br />

created and that the values to, server, cc, name, from, subject, and message are<br />

the names of the parameters that will be sent to the mailer.jsp when the form is<br />

submitted.<br />

The steps in this example are as follows:<br />

1. Create a JSP<br />

2. Add a taglib directive to the JSP<br />

3. Add the appropriate taglib tags to the JSP<br />

4. Insert the final JSP scriptlet and HTML code into the JSP<br />

9.3.1 Step 1: Creating a JSP<br />

to, server, cc,<br />

name,<br />

from, subject,<br />

message<br />

<br />

<br />

<br />

<br />

<br />

<br />

Name: <br />

Message: <br />

<br />

<br />

The following errors occured<br />

<br />

<br />

<br />

Please back up a page, fix the error and resubmit.<br />

<br />

<br />

Thank you<br />

<br />

Your message has been successfully sent.<br />

The first step in this example is to create a JSP called mailer.jsp. This file should<br />

be placed in the info_request folder under the WebContent directory.<br />

1. Open the Web perspective.<br />

2. Navigate to the WebContent/info_request folder of the OnlineCatalog project,<br />

right-click it, and select New -> JSP File from the context menu. The New<br />

JSP File wizard opens.<br />

3. Specify the File Name as mailer.jsp.<br />

4. Click Next.<br />

5. On the Tag Libraries page, we could add the tab library that we require, but<br />

we will do this later on in the example. Click Finish. The mailer.jsp is created<br />

and opened in Page designer.<br />

.<br />

.<br />

.<br />

Chapter 9. Using tag libraries 303

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

Saved successfully!

Ooh no, something went wrong!