Creating a JSP or Servlet Source File

JSP and servlet source files are created and managed in the IDE in much the same way as other file types. Note that the filesystem containing existing JSP and servlet files needs to be mounted before you can use it. You also need to create a web module before you create a JSP or servlet.

To create a JSP or servlet source file:

  1. From the main window, choose File and choose New to display the New From Template Wizard.
  2. In the New from Template Wizard, click the JSP template category and choose JSP or Servlet. Click Next.
  3. In the Target Location pane, type the name of your JSP or servlet, and choose the folder (package) of your JSP or servlet file. Do not include a filename extension as this is added automatically when the file is created.
  4. Click Finish. The JSP or servlet file is created and opened for editing in the IDE Source Editor.

If you create a servlet outside the IDE, it is treated by the IDE as an ordinary Java class. For the servlet features to be available, you must tell the IDE to treat this class as a servlet. From the main menu, choose Tools and choose Mark as Servlet.

For information on other file management tasks, such as mounting and unmounting filesystems, creating and customizing templates, and searching for files, see Filesystems and Objects.

See also
Editing a JSP or Servlet Source File
Compiling a JSP Source File
Running a JSP or Servlet File

Legal Notices