15.4.2 Realizing the index.jsp page
The first component you will realize is the initial index.jsp page as follows:
1. In the Web diagram, double-click index.jsp.
2. The New JSP File wizard appears. All fields should have been properly added by the wizard. See Figure 15-17 to verify that this is the case.
Figure 15-17 New JSP File window
3. Check Configure advanced options and click Next >.
4. In the Tag libraries page, remove all tag libraries by selecting them and clicking Remove.
5. Click Add.
6. In the Select a tag library page, check the /WEB-INF/struts-logic.tld tag library. Click OK.
Figure 15-18 Selecting a tag library
7. Click Next.
Figure 15-19 Selected tag library
8. JSP file options. Take default values for encoding, content type and other values. Click Next.
9. JSP file method stubs. Take default values for method stub creation. Click Next.
10. In the Form field selection page, uncheck Generate fields in a form. Click Finish to generate the JSP.
Figure 15-20 Form Field Selection
11. In the JSP editor, select the source tab and replace the page with the following code shown in Example 15-2. Example 15-2 index.jsp page
<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic"%> <%@ page language="java" contentType="text/html; charset=ISO-8859-1" pageEncoding="ISO-8859-1"%> <logic:forward name="welcome"/>
![]()
This tag indicates that it will forward to the global forward welcome and the action mappings should resolve where to go. In this scenario welcome.do should point to the action code. This will be done later in 15.4.7, Realizing the welcome action mapping.
12. Save the file and close the JSP editor.
ibm.com/redbooks