InfoCenter Home >
4: Developing applications >
4.2: Building Web applications >
4.2.2: Developing JSP files >
4.2.2.2: JSP support and environment in WebSphere >
4.2.2.2.2: JSP processors

4.2.2.2.2: JSP processors

IBM WebSphere Application Server provides a JSP processor for each supported level of the JSP specification, .91 and 1.0. Each JSP processor is a servlet that you can add to a Web application to handle all JSP requests pertaining to the Web application.

When you install the Application Server product on a Web server, the Web server configuration is set to pass HTTP requests for JSP files (files with the extension .jsp) to the Application Server product.

By specifying either a .91, 1.0 or 1.1 JSP Enabler for each Web application containing JSP files, you configure Web applications to pass JSP files in the Web application folder to the JSP processor corresponding to the JSP specification level of the JSP files.

The JSP processor creates and compiles a servlet from each JSP file. The processor produces these files for each JSP file:

  • .java file, which contains the Java language code for the servlet
  • .class file, which is the compiled servlet

The JSP processor puts the .java, and the .class file in a path specific to the processor (see below). The .java and the .class file have the same filename. The processor uses a naming convention that includes adding underscore characters and a suffix to the JSP filename.

For example, if the JSP filename is simple.jsp, the generated files are _simple_xjsp.java and _simple_xjsp.class.

Like all servlets, a servlet generated from a JSP file extends javax.servlet.http.HttpServlet. The servlet Java code contains import statements for the necessary classes and a package statement, if the servlet class is part of a package.

If the JSP file contains JSP syntax (such as directives and scriptlets), the JSP processor converts the JSP syntax to the equivalent Java code. If the JSP file contains HTML tags, the processor adds Java code so that the servlet outputs the HTML character by character.

JSP 1.0 processor

Processor servlet name JSP Servlet
Class name and location com.sun.jsp.runtime.JspServlet in jsp10.jar
Where processor puts output product_installation_root\temp\servlet_host_name\app_name\???????

For example, if the JSP file is in:

c:\WebSphere\AppServer\hosts\default_host\examples\web
the .java and .class files are put in:
c:\WebSphere\AppServer\temp\default_host\examples\???????

JSP .91 processor

Processor servlet name PageCompileServlet
Class name and location com.ibm.servlet.jsp.http.pagecompile.PageCompileServlet in ibmwebas.jar
Where processor puts output
product_installation_root\temp\servlet_host_name\app_name\pagecompile
where product_installation_root is the path where the Application Server is installed and app_name is the name of the application root folder.

For example, if the JSP file is in:

c:\WebSphere\AppServer\hosts\default_host\examples\web
the .java and .class files are put in:
c:\WebSphere\AppServer\temp\default_host\examples\pagecompile

Go to previous article: JSP support for separating logic from presentation Go to next article: Java Server Page attributes

 

 
Go to previous article: JSP support for separating logic from presentation Go to next article: Java Server Page attributes