Package org.apache.jasper.servlet
Class JspServletWrapper
- java.lang.Object
-
- org.apache.jasper.servlet.JspServletWrapper
-
public class JspServletWrapper extends java.lang.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.
-
-
Field Summary
Fields Modifier and Type Field Description private long
available
private JasperException
compileException
private javax.servlet.ServletConfig
config
private JspCompilationContext
ctxt
private boolean
firstTime
private boolean
isTagFile
private java.io.File
jspFile
private JspProbeEmitter
jspProbeEmitter
private java.lang.String
jspUri
private long
lastModificationTest
private static java.util.logging.Logger
log
private Options
options
private boolean
reload
private java.lang.Class
servletClass
private long
servletClassLastModifiedTime
private java.lang.Class
tagHandlerClass
private javax.servlet.Servlet
theServlet
private int
tripCount
-
Constructor Summary
Constructors Constructor Description JspServletWrapper(javax.servlet.ServletConfig config, Options options, java.lang.String jspUri, boolean isErrorPage, JspRuntimeContext rctxt)
JspServletWrapper(javax.servlet.ServletContext servletContext, Options options, java.lang.String tagFilePath, TagInfo tagInfo, JspRuntimeContext rctxt, java.net.URL tagFileJarUrl)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description int
decTripCount()
void
destroy()
java.util.List<java.lang.String>
getDependants()
Get a list of files that the current page has source dependency on.JspCompilationContext
getJspEngineContext()
java.io.File
getJspFile()
long
getLastModificationTest()
javax.servlet.Servlet
getServlet()
long
getServletClassLastModifiedTime()
Gets the last-modified time of the servlet class file associated with this JspServletWrapper.javax.servlet.ServletContext
getServletContext()
int
incTripCount()
boolean
isTagFile()
private void
jspFileNotFound(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)
java.lang.Class
loadTagFile()
Compile (if needed) and load a tag filejava.lang.Class
loadTagFilePrototype()
Compile and load a prototype for the Tag file.void
service(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, boolean precompile)
void
setCompilationException(JasperException je)
Sets the compilation exception for this JspServletWrapper.void
setLastModificationTest(long lastModificationTest)
void
setReload(boolean reload)
void
setServletClassLastModifiedTime(long lastModified)
Sets the last-modified time of the servlet class file associated with this JspServletWrapper.
-
-
-
Field Detail
-
log
private static java.util.logging.Logger log
-
theServlet
private javax.servlet.Servlet theServlet
-
jspUri
private java.lang.String jspUri
-
servletClass
private java.lang.Class servletClass
-
tagHandlerClass
private java.lang.Class tagHandlerClass
-
ctxt
private JspCompilationContext ctxt
-
available
private long available
-
config
private javax.servlet.ServletConfig config
-
options
private Options options
-
firstTime
private boolean firstTime
-
reload
private boolean reload
-
isTagFile
private boolean isTagFile
-
tripCount
private int tripCount
-
compileException
private JasperException compileException
-
jspProbeEmitter
private JspProbeEmitter jspProbeEmitter
-
servletClassLastModifiedTime
private long servletClassLastModifiedTime
-
jspFile
private java.io.File jspFile
-
lastModificationTest
private long lastModificationTest
-
-
Constructor Detail
-
JspServletWrapper
JspServletWrapper(javax.servlet.ServletConfig config, Options options, java.lang.String jspUri, boolean isErrorPage, JspRuntimeContext rctxt) throws JasperException
- Throws:
JasperException
-
JspServletWrapper
public JspServletWrapper(javax.servlet.ServletContext servletContext, Options options, java.lang.String tagFilePath, TagInfo tagInfo, JspRuntimeContext rctxt, java.net.URL tagFileJarUrl) throws JasperException
- Throws:
JasperException
-
-
Method Detail
-
getJspEngineContext
public JspCompilationContext getJspEngineContext()
-
setReload
public void setReload(boolean reload)
-
getServlet
public javax.servlet.Servlet getServlet() throws javax.servlet.ServletException, java.io.IOException, java.lang.ClassNotFoundException
- Throws:
javax.servlet.ServletException
java.io.IOException
java.lang.ClassNotFoundException
-
getServletContext
public javax.servlet.ServletContext getServletContext()
-
setCompilationException
public void setCompilationException(JasperException je)
Sets the compilation exception for this JspServletWrapper.- Parameters:
je
- The compilation exception
-
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
-
getServletClassLastModifiedTime
public long getServletClassLastModifiedTime()
Gets the last-modified time of the servlet class file associated with this JspServletWrapper.- Returns:
- Last-modified time of servlet class
-
loadTagFile
public java.lang.Class loadTagFile() throws JasperException
Compile (if needed) and load a tag file- Throws:
JasperException
-
loadTagFilePrototype
public java.lang.Class loadTagFilePrototype() throws JasperException
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.- Throws:
JasperException
-
getDependants
public java.util.List<java.lang.String> getDependants()
Get a list of files that the current page has source dependency on.
-
isTagFile
public boolean isTagFile()
-
incTripCount
public int incTripCount()
-
decTripCount
public int decTripCount()
-
service
public void service(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, boolean precompile) throws javax.servlet.ServletException, java.io.IOException
- Throws:
javax.servlet.ServletException
java.io.IOException
-
destroy
public void destroy()
-
getLastModificationTest
public long getLastModificationTest()
- Returns:
- Returns the lastModificationTest.
-
setLastModificationTest
public void setLastModificationTest(long lastModificationTest)
- Parameters:
lastModificationTest
- The lastModificationTest to set.
-
getJspFile
public java.io.File getJspFile()
-
jspFileNotFound
private void jspFileNotFound(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response) throws javax.servlet.ServletException, java.io.IOException
- Throws:
javax.servlet.ServletException
java.io.IOException
-
-