Top
Interstage Studio User's Guide
FUJITSU Software

2.3.4 Creating a JSP File

To create a JSP file, use the JSP wizard to generate the JSP file. Then use the JSP editor or a similar editor to set the page layout, operation, and so on. The method is described below.

2.3.4.1 Creating a New JSP File

From the [New] wizard, select [Web] > [JSP], and the wizard generates the JSP file. Refer to the following for the wizard settings:

Point

  • For files that are meant to be fetched by another JSP file using an include directive (<%@ include file="..."%>) or similar, rather than being invoked directly as JSP, do not use ".jsp" as the extension. Use an extension such as ".jspf" for such files.

  • If the extension is omitted, the extension that is used, and the embedded encoding used during file creation, can be customized using [Web] > [JSP Files] on the preferences page.

2.3.4.2 Editing the JSP File

Use the JSP editor to edit a JSP file. The JSP editor is a text editor that has the following features:

Use the appropriate view from the following when editing using the JSP editor:

JSP editor operation is the same as for the HTML editor. Refer to "2.3.3.2 Editing the HTML File".

Using JSP Extended Tags

If you are setting JSP extended tags that will be needed during Web application operation, JSP extended tags are displayed in the Contents Assist list. For this, use the following procedure:

  1. Specify the JSP tag library location.
    Use one of the following methods to specify the tag library:

    • Code the taglib tag in web.xml, and specify the .tld file location.

    • Place the .tld file in /WEB-INF.

    • Place the JAR file in WEB-INF/lib. The JAR file contains the tld file that is stored in the /META-INF.

  2. Code a taglib directive in the JSP file.
    To display JSP extended tags in the Contents Assist list, code a taglib directive in the JSP file.
    To code a taglib directive, select the template "JSP taglib directive" from Contents Assist. Contents Assist can be used even when entering uri attribute values. In addition, if the taglib uri is specified in the uri attribute, Contents Assist can be used to input the prefix attribute value, and the default prefix specified in taglib is displayed in the Contents Assist list.

Note

  • The tag configuration may collapse and an error may occur if a JSP file meeting the condition below is opened using the JSP Editor and [Source] > [Format] is executed from the menu. Use a Web Page Editor to execute [Format] with a JSP file that uses JavaScript.

    • An attribute for JavaScript is described within a tag, and JavaScript is used (Example: onclick attributes, and so on).

  • Attributes added using JSP2.1 (such as trimDirectiveWhitespaces) and specified in the JSP file will not be recognized (a warning will be displayed in the Problems view), but will not cause any errors.

2.3.4.3 Validating the JSP

The validators available for verifying JSP are the JSP syntax validator and the JSP content validator. For details on validation, refer to "6.2.5.2 Validation".

Note

The validators do not check for correct correspondence between JSP start tags and end tags. Thus, errors and warnings are not output in the Problems view. However, lack of correspondence between start tags and end tags may result in errors being detected during compilation of Java code converted from the JSP file.