alt
Advertisement
Sponsored links
Online Training
Career Series
Exforsys
Exforsys arrow Tutorials arrow WebSphere arrow WebSphere V5.0 : Web Development - Use Web Page Wizards
Site Search


WebSphere V5.0 : Web Development - Use Web Page Wizards
Article Index
WebSphere V5.0 : Web Development - Use Web Page Wizards
Page 2
Page 3

.

.

WebSphere V5.0 : Web Development - Use Web Page Wizards

In this tutorial you will learn about WebSphere V5.0 : Web Development - Use Web Page Wizards Creating JavaServer Pages (JSP) files, Creating Web pages from Java beans and Creating Web pages from SQL statements.

Creating JavaServer Pages (JSP) files

You can create and edit a JSP file in Page Designer by adding your own text and images using JavaScript, HTML, or JSP tagging, including Java source code inside of scriptlet tags. You can also create JSP files hat are based on Struts or JavaServer faces architecture.

To create a new JSP file, do the following:

1. To launch the New JSP File wizard, select File > New > JSP File.

2. Select the appropriate container for the file from the list of project folders (and subfolders).

The folder that you choose should be under the Web Content folder of the Web project. If a JSP file is not under this folder, then it will not be included in the WAR file that is deployed to the server. In addition, link validation will not encompass files that are not under the Web content folder.

3. Type a file name into the appropriate field.

4. Ensure that the appropriate option is displayed in the Markup Language drop-down list.

In addition, if you select the Create as JSP Fragment check box, this file will be created as a fragment that can be added to another JSP file. Other JSP files can include JSP fragments using a JSP include directive. Creating a fragment causes the resulting file to end in a .jspf or .jsf extension. You will not be prompted for DOCTYPE information, because a fragment cannot stand alone as a Web page, and it would invalidate any JSP file that included it.

Also, depending which markup language you select, you can select the Use XML Style Syntax option to create a JSP file that adheres to XML style tagging.

5. You have several options for proceeding:

  • If you want to accept the defaults associated with a new JSP file, leave Model as None.
  • If you want to create a JSP file that uses Struts architecture, select Struts JSP in the Model field.


New JSP Wizard

6. Click Finish to create the file, or Next to provide additional information.

7. Optionally add tag libraries from a variety of sources by clicking the Add Tag Library button to locate a TLD file or a JAR file that contains a TLD file. Tag library Universal Resource Identifier (URIs) can be located in one of the following places:

  • Defined in the web.xml file
  • Within a JAR file located in the project lib directory that contains /META-INF/taglib.tld
  • Within a JAR file external to the project
  • In a "loose" TLD anywhere in the project

In the Select a Tag Library dialog, either select one of the available tag libraries, or click the Import button to locate and add a tag library to the list, and then select it. The dialog will automatically populate the informational fields that describe the tag library and its contents. You must specify a Prefix value. Click OK to add the tag library:

Select a tag library

8. As you add tag libraries, the Available Custom Tags window displays the the declaration of the tag along with the tag library directive. If the selected TLD file that hasn't been registered in the web.xml file, it will be added automatically.

Available Custom Tags

9. Click Next to supply page directive information for the JSP file. The imported class and package information are editable. Use the checkboxes to define any additional attributes, including a buffer size, an associated error page, and other modal options.

Page directive information

10. Click Next to supply encoding, DOCTYPE and style sheet information.

11. Select the appropriate encoding value to add to the JSP's declaration from the Encoding list button. The default is the value set in the JSP Files preferences page, which is accessed by selecting Window > Preferences, and then expanding the Web and XML Files preferences.

12. Ensure that the proper content type is selected in the Content Type drop-down list.

13. Select the HTML Document Type that you wish to associate with the JSP file. Depending on which Document Type that you select using the list button, the corresponding Public ID, and, if appropriate, System ID will be displayed.



 
< Prev   Next >
Exforsys Offers
© 2008 Exforsys.com
Joomla! is Free Software released under the GNU/GPL License.
Page copy protected against web site content infringement by Copyscape