Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

org.apache.jasper.servlet
Class JspServlet  view JspServlet download JspServlet.java

java.lang.Object
  extended byjavax.servlet.GenericServlet
      extended byjavax.servlet.http.HttpServlet
          extended byorg.apache.jasper.servlet.JspServlet
All Implemented Interfaces:
java.io.Serializable, javax.servlet.Servlet, javax.servlet.ServletConfig

public class JspServlet
extends javax.servlet.http.HttpServlet

The JSP engine (a.k.a Jasper). The servlet container is responsible for providing a URLClassLoader for the web application context Jasper is being used in. Jasper will try get the Tomcat ServletContext attribute for its ServletContext class loader, if that fails, it uses the parent class loader. In either case, it must be a URLClassLoader.


Field Summary
private  javax.servlet.ServletConfig config
           
private  javax.servlet.ServletContext context
           
private  org.apache.commons.logging.Log log
           
private  org.apache.jasper.Options options
           
private  org.apache.jasper.compiler.JspRuntimeContext rctxt
           
 
Fields inherited from class javax.servlet.http.HttpServlet
 
Constructor Summary
JspServlet()
           
 
Method Summary
 void destroy()
          Called by the servlet container to indicate to a servlet that the servlet is being taken out of service.
 int getJspCount()
          Returns the number of JSPs for which JspServletWrappers exist, i.e., the number of JSPs that have been loaded into the webapp with which this JspServlet is associated.
 int getJspReloadCount()
          Gets the number of JSPs that have been reloaded.
 void init(javax.servlet.ServletConfig config)
          Called by the servlet container to indicate to a servlet that the servlet is being placed into service.
(package private)  boolean preCompile(javax.servlet.http.HttpServletRequest request)
          Look for a precompilation request as described in Section 8.4.2 of the JSP 1.2 Specification.
 void service(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)
          Receives standard HTTP requests from the public service method and dispatches them to the doXXX methods defined in this class.
private  void serviceJspFile(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, java.lang.String jspUri, java.lang.Throwable exception, boolean precompile)
           
 void setJspReloadCount(int count)
          Resets the JSP reload counter.
 
Methods inherited from class javax.servlet.http.HttpServlet
doDelete, doGet, doHead, doOptions, doPost, doPut, doTrace, getLastModified, service
 
Methods inherited from class javax.servlet.GenericServlet
getInitParameter, getInitParameterNames, getServletConfig, getServletContext, getServletInfo, getServletName, init, log, log
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

log

private org.apache.commons.logging.Log log

context

private javax.servlet.ServletContext context

config

private javax.servlet.ServletConfig config

options

private org.apache.jasper.Options options

rctxt

private org.apache.jasper.compiler.JspRuntimeContext rctxt
Constructor Detail

JspServlet

public JspServlet()
Method Detail

init

public void init(javax.servlet.ServletConfig config)
          throws javax.servlet.ServletException
Description copied from class: javax.servlet.GenericServlet
Called by the servlet container to indicate to a servlet that the servlet is being placed into service. See Servlet.init(javax.servlet.ServletConfig)>Servlet.init(javax.servlet.ServletConfig) 55 .

This implementation stores the javax.servlet.ServletConfig object it receives from the servlet container for later use. When overriding this form of the method, call super.init(config).


getJspCount

public int getJspCount()
Returns the number of JSPs for which JspServletWrappers exist, i.e., the number of JSPs that have been loaded into the webapp with which this JspServlet is associated.

This info may be used for monitoring purposes.


setJspReloadCount

public void setJspReloadCount(int count)
Resets the JSP reload counter.


getJspReloadCount

public int getJspReloadCount()
Gets the number of JSPs that have been reloaded.

This info may be used for monitoring purposes.


preCompile

boolean preCompile(javax.servlet.http.HttpServletRequest request)
             throws javax.servlet.ServletException

Look for a precompilation request as described in Section 8.4.2 of the JSP 1.2 Specification. WARNING - we cannot use request.getParameter() for this, because that will trigger parsing all of the request parameters, and not give a servlet the opportunity to call request.setCharacterEncoding() first.


service

public void service(javax.servlet.http.HttpServletRequest request,
                    javax.servlet.http.HttpServletResponse response)
             throws javax.servlet.ServletException,
                    java.io.IOException
Description copied from class: javax.servlet.http.HttpServlet
Receives standard HTTP requests from the public service method and dispatches them to the doXXX methods defined in this class. This method is an HTTP-specific version of the Servlet.service(javax.servlet.ServletRequest, javax.servlet.ServletResponse)>Servlet.service(javax.servlet.ServletRequest, javax.servlet.ServletResponse) 55 method. There's no need to override this method.


destroy

public void destroy()
Description copied from class: javax.servlet.GenericServlet
Called by the servlet container to indicate to a servlet that the servlet is being taken out of service. See Servlet.destroy()>Servlet.destroy() 55 .


serviceJspFile

private void serviceJspFile(javax.servlet.http.HttpServletRequest request,
                            javax.servlet.http.HttpServletResponse response,
                            java.lang.String jspUri,
                            java.lang.Throwable exception,
                            boolean precompile)
                     throws javax.servlet.ServletException,
                            java.io.IOException