JspFactoryImplpublic class JspFactoryImpl extends javax.servlet.jsp.JspFactory Implementation of JspFactory. |
Fields Summary |
---|
private static com.sun.org.apache.commons.logging.Log | log | private static final String | SPEC_VERSION | private static final boolean | USE_POOL | private ThreadLocal | pool |
Methods Summary |
---|
public javax.servlet.jsp.JspEngineInfo | getEngineInfo()
return new JspEngineInfo() {
public String getSpecificationVersion() {
return SPEC_VERSION;
}
};
| public javax.servlet.jsp.JspApplicationContext | getJspApplicationContext(javax.servlet.ServletContext context)
return JspApplicationContextImpl.findJspApplicationContext(context);
| public javax.servlet.jsp.PageContext | getPageContext(javax.servlet.Servlet servlet, javax.servlet.ServletRequest request, javax.servlet.ServletResponse response, java.lang.String errorPageURL, boolean needsSession, int bufferSize, boolean autoflush)
if (Constants.IS_SECURITY_ENABLED) {
PrivilegedGetPageContext dp = new PrivilegedGetPageContext(
(JspFactoryImpl)this, servlet, request, response, errorPageURL,
needsSession, bufferSize, autoflush);
return (PageContext)AccessController.doPrivileged(dp);
} else {
return internalGetPageContext(servlet, request, response,
errorPageURL, needsSession,
bufferSize, autoflush);
}
| private javax.servlet.jsp.PageContext | internalGetPageContext(javax.servlet.Servlet servlet, javax.servlet.ServletRequest request, javax.servlet.ServletResponse response, java.lang.String errorPageURL, boolean needsSession, int bufferSize, boolean autoflush)
try {
PageContext pc = null;
if( USE_POOL ) {
LinkedList<PageContext> pcPool = (LinkedList<PageContext>)
pool.get();
if (!pcPool.isEmpty()) {
pc = pcPool.removeFirst();
}
if (pc == null) {
pc = new PageContextImpl(this);
}
} else {
pc = new PageContextImpl(this);
}
pc.initialize(servlet, request, response, errorPageURL,
needsSession, bufferSize, autoflush);
return pc;
} catch (Throwable ex) {
/* FIXME: need to do something reasonable here!! */
log.fatal("Exception initializing page context", ex);
return null;
}
| private void | internalReleasePageContext(javax.servlet.jsp.PageContext pc)
pc.release();
if (USE_POOL && (pc instanceof PageContextImpl)) {
LinkedList<PageContext> pcPool = (LinkedList<PageContext>) pool.get();
pcPool.addFirst(pc);
}
| public void | releasePageContext(javax.servlet.jsp.PageContext pc)
if( pc == null )
return;
if (Constants.IS_SECURITY_ENABLED) {
PrivilegedReleasePageContext dp = new PrivilegedReleasePageContext(
(JspFactoryImpl)this,pc);
AccessController.doPrivileged(dp);
} else {
internalReleasePageContext(pc);
}
|
|