org.apache.jasper.servlet

Class JspServletWrapper

public class JspServletWrapper extends Object

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.

Author: Anil K. Vijendran Harish Prabandham Remy Maucherat Kin-man Chung Glenn Nielsen Tim Fennell

Constructor Summary
JspServletWrapper(ServletConfig config, Options options, String jspUri, boolean isErrorPage, JspRuntimeContext rctxt)
JspServletWrapper(ServletContext servletContext, Options options, String tagFilePath, TagInfo tagInfo, JspRuntimeContext rctxt, URL tagFileJarUrl)
Method Summary
intdecTripCount()
voiddestroy()
ListgetDependants()
Get a list of files that the current page has source dependency on.
JspCompilationContextgetJspEngineContext()
longgetLastModificationTest()
ServletgetServlet()
ServletContextgetServletContext()
protected JasperExceptionhandleJspException(Exception ex)

Attempts to construct a JasperException that contains helpful information about what went wrong.

intincTripCount()
booleanisTagFile()
ClassloadTagFile()
Compile (if needed) and load a tag file
ClassloadTagFilePrototype()
Compile and load a prototype for the Tag file.
voidservice(HttpServletRequest request, HttpServletResponse response, boolean precompile)
voidsetCompilationException(JasperException je)
Sets the compilation exception for this JspServletWrapper.
voidsetLastModificationTest(long lastModificationTest)
voidsetReload(boolean reload)
voidsetServletClassLastModifiedTime(long lastModified)
Sets the last-modified time of the servlet class file associated with this JspServletWrapper.

Constructor Detail

JspServletWrapper

public JspServletWrapper(ServletConfig config, Options options, String jspUri, boolean isErrorPage, JspRuntimeContext rctxt)

JspServletWrapper

public JspServletWrapper(ServletContext servletContext, Options options, String tagFilePath, TagInfo tagInfo, JspRuntimeContext rctxt, URL tagFileJarUrl)

Method Detail

decTripCount

public int decTripCount()

destroy

public void destroy()

getDependants

public List getDependants()
Get a list of files that the current page has source dependency on.

getJspEngineContext

public JspCompilationContext getJspEngineContext()

getLastModificationTest

public long getLastModificationTest()

Returns: Returns the lastModificationTest.

getServlet

public Servlet getServlet()

getServletContext

public ServletContext getServletContext()

handleJspException

protected JasperException handleJspException(Exception ex)

Attempts to construct a JasperException that contains helpful information about what went wrong. Uses the JSP compiler system to translate the line number in the generated servlet that originated the exception to a line number in the JSP. Then constructs an exception containing that information, and a snippet of the JSP to help debugging. Please see http://issues.apache.org/bugzilla/show_bug.cgi?id=37062 and http://www.tfenne.com/jasper/ for more details.

Parameters: ex the exception that was the cause of the problem.

Returns: a JasperException with more detailed information

incTripCount

public int incTripCount()

isTagFile

public boolean isTagFile()

loadTagFile

public Class loadTagFile()
Compile (if needed) and load a tag file

loadTagFilePrototype

public Class loadTagFilePrototype()
Compile and load a prototype for the Tag file. This is needed when compiling tag files with circular dependencies. A prototpe (skeleton) with no dependencies on other other tag files is generated and compiled.

service

public void service(HttpServletRequest request, HttpServletResponse response, boolean precompile)

setCompilationException

public void setCompilationException(JasperException je)
Sets the compilation exception for this JspServletWrapper.

Parameters: je The compilation exception

setLastModificationTest

public void setLastModificationTest(long lastModificationTest)

Parameters: lastModificationTest The lastModificationTest to set.

setReload

public void setReload(boolean reload)

setServletClassLastModifiedTime

public void setServletClassLastModifiedTime(long lastModified)
Sets the last-modified time of the servlet class file associated with this JspServletWrapper.

Parameters: lastModified Last-modified time of servlet class

Copyright © 2000-2011 Apache Software Foundation. All Rights Reserved.