JavaServer Page wizard
This is a feature of JBuilder Enterprise.
The JavaServer Page (JSP) wizard creates a JSP consisting of two files and adds them to the existing project. The JSP that is created by this wizard is based on the JSP 2.0 specification.
JSP technology-based pages use XML tags and scriptlets written in the JavaTM programming language to encapsulate the logic that generates the content for the page. It passes any formatting (HTML or XML) tags directly back to the response page. In this way, JSP technology-based pages separate the page logic from its design and display. JSP technology-based pages may call JavaBeansTM technology-based components (beans) or Enterprise JavaBeansTM technology-based components (enterprise beans) to perform processing on the server.
JavaServer Pages are discussed in more detail, including a tutorial for developing a JSP and links for more information, in "Developing JavaServer Pages".
The JSP wizard creates the following files:
To open the JSP wizard, choose File|New, select the Enterprise tab of the Object Gallery, then select JavaServer Page.
The JSP wizard consists of three pages:
Step 1 of 3
Package
Displays the package name derived from the project file. To assign a different package name to the JSP, click in the Package field and type in a new name.
For more information on packages, see the "Packages" topic in the "Creating and managing projects" chapter of Building Applications with JBuilder.
Name
The name of the JSP. A file with this name and the the extension JSP will be created, as well as a file with this name, the word Bean, and the extension JAVA.
Generate Submit Form
Check this option to enable the JSP wizard to generate a FORM tag in the JSP file.
Declare InternetBeans Express tag library, prefix:
Enter the prefix to use for the InternetBeans Express tag library. The default is: ix
Background
The color of the background of the JSP file as it appears in the browser.
Generate Error Page
Check this option to enable the JSP wizard to create an error page. A file named <name>ErrorPage.JSP
is added to the project.
Generate Sample Bean
Check this option to enable the JSP wizard to create a sample JavaBean in the JAVA file, and to create a JSP tag in the JSP file that uses the sample JavaBean.
Step 2 of 3
This page lets you modify the settings for the JavaBean that will be used by the main JSP page.
Name
Modify the generated name.
Generate Header Comments
Uses information from the project file as header comments at the top of the applet class file. This is the information entered in the Project wizard when creating the project file.
//Title: Your Product Name
//Version:
//Copyright: Copyright (c) 1997
//Author: Your Name
//Company: Your Company
//Description: Your description
Step 3 of 3
This page provides an easy way to locate additional JavaBeans, add them to your project, and add JSP tags that reference these beans to the JSP file. The bean can then be used within the page.
For example, if you have defined a bean called showDate()
in another project, selecting it here will add a <jsp:useBean> tag to the JSP file. To use the bean within the page, you could add the following line to the JSP file:
The date is <%= date.showDate() =<
which may display as follows in the browser or Web View pane:
The date is Thursday, April 6, 2000
Add Bean
Select this button to launch the class finder, which helps you locate the bean to be added to this project. When a bean is selected the Class, ID, and Scope fields will be filled in. Each of these fields may be edited, as necessary.
Remove Bean
Click this button to remove the selected bean from the project.
Class
Displays the bean chosen when Add Bean was selected. A useBean
tag will be placed in the JSP file for each bean displayed.
ID
An identification tag within the JSP file for the bean. This field may be edited to a more descriptive identification.
Scope
The lifetime of the bean. Select Page, Session, or Application.
Finish
Click Finish to add the JSP and JAVA files to the current project.