本文整理汇总了Java中org.apache.jasper.servlet.JspServletWrapper类的典型用法代码示例。如果您正苦于以下问题:Java JspServletWrapper类的具体用法?Java JspServletWrapper怎么用?Java JspServletWrapper使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
JspServletWrapper类属于org.apache.jasper.servlet包,在下文中一共展示了JspServletWrapper类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: push
import org.apache.jasper.servlet.JspServletWrapper; //导入依赖的package包/类
/**
* Push a newly compiled JspServletWrapper into the queue at first
* execution of jsp. Destroy any JSP that has been replaced in the queue.
*
* @param jsw Servlet wrapper for jsp.
* @return an unloadHandle that can be pushed to front of queue at later execution times.
* */
public FastRemovalDequeue<JspServletWrapper>.Entry push(JspServletWrapper jsw) {
if (log.isTraceEnabled()) {
log.trace(Localizer.getMessage("jsp.message.jsp_added",
jsw.getJspUri(), context.getContextPath()));
}
FastRemovalDequeue<JspServletWrapper>.Entry entry = jspQueue.push(jsw);
JspServletWrapper replaced = entry.getReplaced();
if (replaced != null) {
if (log.isDebugEnabled()) {
log.debug(Localizer.getMessage("jsp.message.jsp_removed_excess",
replaced.getJspUri(), context.getContextPath()));
}
unloadJspServletWrapper(replaced);
entry.clearReplaced();
}
return entry;
}
示例2: JspCompilationContext
import org.apache.jasper.servlet.JspServletWrapper; //导入依赖的package包/类
public JspCompilationContext(String jspUri, Options options, ServletContext context, JspServletWrapper jsw,
JspRuntimeContext rctxt) {
this.jspUri = canonicalURI(jspUri);
this.options = options;
this.jsw = jsw;
this.context = context;
this.baseURI = jspUri.substring(0, jspUri.lastIndexOf('/') + 1);
// hack fix for resolveRelativeURI
if (baseURI.isEmpty()) {
baseURI = "/";
} else if (baseURI.charAt(0) != '/') {
// strip the base slash since it will be combined with the
// uriBase to generate a file
baseURI = "/" + baseURI;
}
if (baseURI.charAt(baseURI.length() - 1) != '/') {
baseURI += '/';
}
this.rctxt = rctxt;
this.tagFileJarUrls = new HashMap<String, JarResource>();
this.basePackageName = Constants.JSP_PACKAGE_NAME;
}
示例3: push
import org.apache.jasper.servlet.JspServletWrapper; //导入依赖的package包/类
/**
* Push a newly compiled JspServletWrapper into the queue at first execution
* of jsp. Destroy any JSP that has been replaced in the queue.
*
* @param jsw
* Servlet wrapper for jsp.
* @return an unloadHandle that can be pushed to front of queue at later
* execution times.
*/
public FastRemovalDequeue<JspServletWrapper>.Entry push(JspServletWrapper jsw) {
if (log.isTraceEnabled()) {
log.trace(Localizer.getMessage("jsp.message.jsp_added", jsw.getJspUri(), context.getContextPath()));
}
FastRemovalDequeue<JspServletWrapper>.Entry entry = jspQueue.push(jsw);
JspServletWrapper replaced = entry.getReplaced();
if (replaced != null) {
if (log.isDebugEnabled()) {
log.debug(Localizer.getMessage("jsp.message.jsp_removed_excess", replaced.getJspUri(),
context.getContextPath()));
}
unloadJspServletWrapper(replaced);
entry.clearReplaced();
}
return entry;
}
示例4: JspCompilationContext
import org.apache.jasper.servlet.JspServletWrapper; //导入依赖的package包/类
public JspCompilationContext(String jspUri,
Options options,
ServletContext context,
JspServletWrapper jsw,
JspRuntimeContext rctxt) {
this.jspUri = canonicalURI(jspUri);
this.options = options;
this.jsw = jsw;
this.context = context;
this.baseURI = jspUri.substring(0, jspUri.lastIndexOf('/') + 1);
// hack fix for resolveRelativeURI
if (baseURI.isEmpty()) {
baseURI = "/";
} else if (baseURI.charAt(0) != '/') {
// strip the base slash since it will be combined with the
// uriBase to generate a file
baseURI = "/" + baseURI;
}
if (baseURI.charAt(baseURI.length() - 1) != '/') {
baseURI += '/';
}
this.rctxt = rctxt;
this.tagFileJarUrls = new HashMap<String, JarResource>();
this.basePackageName = Constants.JSP_PACKAGE_NAME;
}
示例5: makeYoungest
import org.apache.jasper.servlet.JspServletWrapper; //导入依赖的package包/类
/**
* Push unloadHandle for JspServletWrapper to front of the queue.
*
* @param unloadHandle the unloadHandle for the jsp.
* */
public void makeYoungest(FastRemovalDequeue<JspServletWrapper>.Entry unloadHandle) {
if (log.isTraceEnabled()) {
JspServletWrapper jsw = unloadHandle.getContent();
log.trace(Localizer.getMessage("jsp.message.jsp_queue_update",
jsw.getJspUri(), context.getContextPath()));
}
jspQueue.moveFirst(unloadHandle);
}
示例6: destroy
import org.apache.jasper.servlet.JspServletWrapper; //导入依赖的package包/类
/**
* Process a "destroy" event for this web application context.
*/
public void destroy() {
Iterator<JspServletWrapper> servlets = jsps.values().iterator();
while (servlets.hasNext()) {
servlets.next().destroy();
}
}
示例7: checkCompile
import org.apache.jasper.servlet.JspServletWrapper; //导入依赖的package包/类
/**
* Method used by background thread to check the JSP dependencies
* registered with this class for JSP's.
*/
public void checkCompile() {
if (lastCompileCheck < 0) {
// Checking was disabled
return;
}
long now = System.currentTimeMillis();
if (now > (lastCompileCheck + (options.getCheckInterval() * 1000L))) {
lastCompileCheck = now;
} else {
return;
}
Object [] wrappers = jsps.values().toArray();
for (int i = 0; i < wrappers.length; i++ ) {
JspServletWrapper jsw = (JspServletWrapper)wrappers[i];
JspCompilationContext ctxt = jsw.getJspEngineContext();
// JspServletWrapper also synchronizes on this when
// it detects it has to do a reload
synchronized(jsw) {
try {
ctxt.compile();
} catch (FileNotFoundException ex) {
ctxt.incrementRemoved();
} catch (Throwable t) {
ExceptionUtils.handleThrowable(t);
jsw.getServletContext().log("Background compile failed",
t);
}
}
}
}
示例8: unloadJspServletWrapper
import org.apache.jasper.servlet.JspServletWrapper; //导入依赖的package包/类
private void unloadJspServletWrapper(JspServletWrapper jsw) {
removeWrapper(jsw.getJspUri());
synchronized(jsw) {
jsw.destroy();
}
jspUnloadCount.incrementAndGet();
}
示例9: checkUnload
import org.apache.jasper.servlet.JspServletWrapper; //导入依赖的package包/类
/**
* Method used by background thread to check if any JSP's should be unloaded.
*/
public void checkUnload() {
if (log.isTraceEnabled()) {
int queueLength = -1;
if (jspQueue != null) {
queueLength = jspQueue.getSize();
}
log.trace(Localizer.getMessage("jsp.message.jsp_unload_check",
context.getContextPath(), "" + jsps.size(), "" + queueLength));
}
long now = System.currentTimeMillis();
if (jspIdleTimeout > 0) {
long unloadBefore = now - jspIdleTimeout;
Object [] wrappers = jsps.values().toArray();
for (int i = 0; i < wrappers.length; i++ ) {
JspServletWrapper jsw = (JspServletWrapper)wrappers[i];
synchronized(jsw) {
if (jsw.getLastUsageTime() < unloadBefore) {
if (log.isDebugEnabled()) {
log.debug(Localizer.getMessage("jsp.message.jsp_removed_idle",
jsw.getJspUri(), context.getContextPath(),
"" + (now-jsw.getLastUsageTime())));
}
if (jspQueue != null) {
jspQueue.remove(jsw.getUnloadHandle());
}
unloadJspServletWrapper(jsw);
}
}
}
}
lastJspQueueUpdate = now;
}
示例10: JspCompilationContext
import org.apache.jasper.servlet.JspServletWrapper; //导入依赖的package包/类
public JspCompilationContext(String jspUri,
boolean isErrPage,
Options options,
ServletContext context,
JspServletWrapper jsw,
JspRuntimeContext rctxt) {
this.jspUri = canonicalURI(jspUri);
this.isErrPage = isErrPage;
this.options = options;
this.jsw = jsw;
this.context = context;
this.baseURI = jspUri.substring(0, jspUri.lastIndexOf('/') + 1);
// hack fix for resolveRelativeURI
if (baseURI == null) {
baseURI = "/";
} else if (baseURI.charAt(0) != '/') {
// strip the basde slash since it will be combined with the
// uriBase to generate a file
baseURI = "/" + baseURI;
}
if (baseURI.charAt(baseURI.length() - 1) != '/') {
baseURI += '/';
}
this.rctxt = rctxt;
this.tagFileJarUrls = new HashMap<String, URL>();
this.basePackageName = Constants.JSP_PACKAGE_NAME;
}
示例11: destroy
import org.apache.jasper.servlet.JspServletWrapper; //导入依赖的package包/类
/**
* Process a "destory" event for this web application context.
*/
public void destroy() {
Iterator servlets = jsps.values().iterator();
while (servlets.hasNext()) {
((JspServletWrapper) servlets.next()).destroy();
}
}
示例12: checkCompile
import org.apache.jasper.servlet.JspServletWrapper; //导入依赖的package包/类
/**
* Method used by background thread to check the JSP dependencies
* registered with this class for JSP's.
*/
public void checkCompile() {
if (lastCheck < 0) {
// Checking was disabled
return;
}
long now = System.currentTimeMillis();
if (now > (lastCheck + (options.getCheckInterval() * 1000L))) {
lastCheck = now;
} else {
return;
}
Object [] wrappers = jsps.values().toArray();
for (int i = 0; i < wrappers.length; i++ ) {
JspServletWrapper jsw = (JspServletWrapper)wrappers[i];
JspCompilationContext ctxt = jsw.getJspEngineContext();
// JspServletWrapper also synchronizes on this when
// it detects it has to do a reload
synchronized(jsw) {
try {
ctxt.compile();
} catch (FileNotFoundException ex) {
ctxt.incrementRemoved();
} catch (Throwable t) {
jsw.getServletContext().log("Background compile failed",
t);
}
}
}
}
示例13: makeYoungest
import org.apache.jasper.servlet.JspServletWrapper; //导入依赖的package包/类
/**
* Push unloadHandle for JspServletWrapper to front of the queue.
*
* @param unloadHandle
* the unloadHandle for the jsp.
*/
public void makeYoungest(FastRemovalDequeue<JspServletWrapper>.Entry unloadHandle) {
if (log.isTraceEnabled()) {
JspServletWrapper jsw = unloadHandle.getContent();
log.trace(Localizer.getMessage("jsp.message.jsp_queue_update", jsw.getJspUri(), context.getContextPath()));
}
jspQueue.moveFirst(unloadHandle);
}
示例14: destroy
import org.apache.jasper.servlet.JspServletWrapper; //导入依赖的package包/类
/**
* Process a "destroy" event for this web application context.
*/
public void destroy() {
Iterator<JspServletWrapper> servlets = jsps.values().iterator();
while (servlets.hasNext()) {
servlets.next().destroy();
}
}
示例15: checkCompile
import org.apache.jasper.servlet.JspServletWrapper; //导入依赖的package包/类
/**
* Method used by background thread to check the JSP dependencies registered
* with this class for JSP's.
*/
public void checkCompile() {
if (lastCompileCheck < 0) {
// Checking was disabled
return;
}
long now = System.currentTimeMillis();
if (now > (lastCompileCheck + (options.getCheckInterval() * 1000L))) {
lastCompileCheck = now;
} else {
return;
}
Object[] wrappers = jsps.values().toArray();
for (int i = 0; i < wrappers.length; i++) {
JspServletWrapper jsw = (JspServletWrapper) wrappers[i];
JspCompilationContext ctxt = jsw.getJspEngineContext();
// JspServletWrapper also synchronizes on this when
// it detects it has to do a reload
synchronized (jsw) {
try {
ctxt.compile();
} catch (FileNotFoundException ex) {
ctxt.incrementRemoved();
} catch (Throwable t) {
ExceptionUtils.handleThrowable(t);
jsw.getServletContext().log("Background compile failed", t);
}
}
}
}