Creating a JSP File
See Also
JSP files are created and managed in the IDE in much the same way as other
file types.
- If you put a JSP file in the WEB-INF
folder or any of its subfolder, users cannot access the
JSP file directly through a URL. Instead the JSP must be accessed
through another JSP or through a servlet. You might want to put a
JSP file under the WEB-INF folder to prevent users from
using the JSP file as an entry point to the application.
To create a JSP file:
- From the Projects window or Files window, right-click the project's node
and choose New > Other
from the pop-up menu.
- Under Categories, select Web. Under File Types, select JSP. Click Next.
- Type the name of your JSP. Do not include
a filename extension as this is added automatically when the file is created.
- Click Browse to select a folder to house your JSP file. By default, the
JSP file is created in the web subfolder.
- Select the type of JSP file that you want to create:
- JSP File (Standard Syntax). Standard JSP pages are written using
the standard JSP syntax.
Standard JSP pages typically use the .jsp extension.
- JSP Document (XML Syntax). JSP documents are written
using the JSP document syntax,
which is well formed XML. JSP documents typically have the
.jspx extension. Two examples of the advantages that JSP documents
have over standard JSP pages are:
- You can edit, verify, and view them with XML capable tools,
such as the IDE's Source Editor.
- You can transform them using XSLT tools, such
as the IDE's XSL Transformation command.
- (Optional) Click the Create as a JSP Segment checkbox.
A segment is a file that contains a fragment of JSP text for inclusion
by standard JSP pages and JSP documents. JSP segments typically use the .jspf extension.
- Click Finish. The IDE opens the JSP file for editing in the Source Editor.
- See also
- About Web Applications
- About JavaServer Pages Technology
- About JSP Syntax
- About JSP Character Encoding
- Editing a JSP or HTML File
Legal Notices