EAServer fully supports the features described in the JavaServer Pages 2.0 for J2EE 1.4 specification as well as mapping requests to JSPs as described in the Java Servlet 2.4 specification. In EAServer, the JSP engine is implemented as a generic servlet, which is referred to as the JSP servlet. The JSP servlet handles runtime translation and compilation of JSPs, if required, as well as invoking the generated servlet for a given JSP.
The JSP servlet supports translation of JSPs containing JSP standard directives, standard actions, custom tags, and scripting elements such as declarations, scriptlets, and expressions. For JSPs that include custom JSP tags, a tag handler is loaded every time it is needed. Tag handlers are not pooled. The JSP servlet also supports all the semantics associated with the “extends” attribute.
A Web application is a collection of resources that is mapped to a specific URI prefix. These resources may include JSPs, servlets, HTML files, and images. The URI that is stored in the request data structure is used to retrieve a JSP. The JSP servlet creates a unique name for a generated servlet. These generated servlet names are stored in a hash table. For a given request URI, the JSP servlet determines the generated servlet name to which it corresponds. It then looks up the generated servlet name in the hash table; an entry in the hash table indicates that the JSP has been precompiled.
If a JSP is not precompiled, the JSP servlet invokes the compiler and saves the generated files in the appropriate directory. It then executes the page by invoking the _jspService method on the generated servlet.
If a JSP is precompiled, the JSP servlet compares the timestamp of the JSP and all its nested include files, if any, with the timestamp of the generated servlet. If any timestamp of the JSP is more recent than that of the generated servlet, the JSP is recompiled. If the generated servlet is current, the JSP servlet creates a new instance of the precompiled servlet class and calls _jspService method on it.