当前位置: 首页>>代码示例>>Java>>正文


Java JspServletWrapper类代码示例

本文整理汇总了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;
}
 
开发者ID:liaokailin,项目名称:tomcat7,代码行数:25,代码来源:JspRuntimeContext.java

示例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;
}
 
开发者ID:how2j,项目名称:lazycat,代码行数:26,代码来源:JspCompilationContext.java

示例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;
}
 
开发者ID:how2j,项目名称:lazycat,代码行数:26,代码来源:JspRuntimeContext.java

示例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;
}
 
开发者ID:liaokailin,项目名称:tomcat7,代码行数:29,代码来源:JspCompilationContext.java

示例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);
}
 
开发者ID:liaokailin,项目名称:tomcat7,代码行数:14,代码来源:JspRuntimeContext.java

示例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();
    }
}
 
开发者ID:liaokailin,项目名称:tomcat7,代码行数:10,代码来源:JspRuntimeContext.java

示例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);
            }
        }
    }

}
 
开发者ID:liaokailin,项目名称:tomcat7,代码行数:38,代码来源:JspRuntimeContext.java

示例8: unloadJspServletWrapper

import org.apache.jasper.servlet.JspServletWrapper; //导入依赖的package包/类
private void unloadJspServletWrapper(JspServletWrapper jsw) {
    removeWrapper(jsw.getJspUri());
    synchronized(jsw) {
        jsw.destroy();
    }
    jspUnloadCount.incrementAndGet();
}
 
开发者ID:liaokailin,项目名称:tomcat7,代码行数:8,代码来源:JspRuntimeContext.java

示例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;
}
 
开发者ID:liaokailin,项目名称:tomcat7,代码行数:37,代码来源:JspRuntimeContext.java

示例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;
}
 
开发者ID:lamsfoundation,项目名称:lams,代码行数:31,代码来源:JspCompilationContext.java

示例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();
    }
}
 
开发者ID:lamsfoundation,项目名称:lams,代码行数:10,代码来源:JspRuntimeContext.java

示例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);
            }
        }
    }

}
 
开发者ID:lamsfoundation,项目名称:lams,代码行数:37,代码来源:JspRuntimeContext.java

示例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);
}
 
开发者ID:how2j,项目名称:lazycat,代码行数:14,代码来源:JspRuntimeContext.java

示例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();
	}
}
 
开发者ID:how2j,项目名称:lazycat,代码行数:10,代码来源:JspRuntimeContext.java

示例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);
			}
		}
	}

}
 
开发者ID:how2j,项目名称:lazycat,代码行数:37,代码来源:JspRuntimeContext.java


注:本文中的org.apache.jasper.servlet.JspServletWrapper类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。