Example usage for javax.servlet.jsp PageContext initialize

List of usage examples for javax.servlet.jsp PageContext initialize

Introduction

In this page you can find the example usage for javax.servlet.jsp PageContext initialize.

Prototype


abstract public void initialize(Servlet servlet, ServletRequest request, ServletResponse response,
        String errorPageURL, boolean needsSession, int bufferSize, boolean autoFlush)
        throws IOException, IllegalStateException, IllegalArgumentException;

Source Link

Document

The initialize method is called to initialize an uninitialized PageContext so that it may be used by a JSP Implementation class to service an incoming request and response within it's _jspService() method.

Usage

From source file:org.apache.jasper.runtime.JspFactoryImpl.java

private PageContext internalGetPageContext(Servlet servlet, ServletRequest request, ServletResponse response,
        String errorPageURL, boolean needsSession, int bufferSize, boolean autoflush) {
    try {//from   w  ww . j ava 2  s . com
        PageContext pc;
        if (USE_POOL) {
            pc = (PageContext) pool.get();
            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;
    }
}

From source file:org.tinygroup.jspengine.runtime.JspFactoryImpl.java

private PageContext internalGetPageContext(Servlet servlet, ServletRequest request, ServletResponse response,
        String errorPageURL, boolean needsSession, int bufferSize, boolean autoflush) {
    try {/*  w  w w  .j a  v  a  2 s.co m*/
        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;
    }
}