Java Code Examples for org.apache.jasper.Constants#DEFAULT_BUFFER_SIZE

The following examples show how to use org.apache.jasper.Constants#DEFAULT_BUFFER_SIZE . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: TestPageContextImpl.java    From Tomcat8-Source-Read with MIT License 5 votes vote down vote up
@Override
protected void doGet(HttpServletRequest req, HttpServletResponse resp)
        throws ServletException, IOException {

    PageContext pageContext = JspFactory.getDefaultFactory().getPageContext(
            this, req, resp, null, false, JspWriter.DEFAULT_BUFFER, true);
    JspWriter out = pageContext.getOut();
    if (Constants.DEFAULT_BUFFER_SIZE == out.getBufferSize()) {
        resp.getWriter().println("OK");
    } else {
        resp.getWriter().println("FAIL");
    }
}
 
Example 2
Source File: TestPageContextImpl.java    From Tomcat7.0.67 with Apache License 2.0 5 votes vote down vote up
@Override
protected void doGet(HttpServletRequest req, HttpServletResponse resp)
        throws ServletException, IOException {

    PageContext pageContext = JspFactory.getDefaultFactory().getPageContext(
            this, req, resp, null, false, JspWriter.DEFAULT_BUFFER, true);
    JspWriter out = pageContext.getOut();
    if (Constants.DEFAULT_BUFFER_SIZE == out.getBufferSize()) {
        resp.getWriter().println("OK");
    } else {
        resp.getWriter().println("FAIL");
    }
}
 
Example 3
Source File: TestPageContextImpl.java    From tomcatsrc with Apache License 2.0 5 votes vote down vote up
@Override
protected void doGet(HttpServletRequest req, HttpServletResponse resp)
        throws ServletException, IOException {

    PageContext pageContext = JspFactory.getDefaultFactory().getPageContext(
            this, req, resp, null, false, JspWriter.DEFAULT_BUFFER, true);
    JspWriter out = pageContext.getOut();
    if (Constants.DEFAULT_BUFFER_SIZE == out.getBufferSize()) {
        resp.getWriter().println("OK");
    } else {
        resp.getWriter().println("FAIL");
    }
}
 
Example 4
Source File: JspWriterImpl.java    From Tomcat8-Source-Read with MIT License 4 votes vote down vote up
public JspWriterImpl() {
    super( Constants.DEFAULT_BUFFER_SIZE, true );
}
 
Example 5
Source File: PageContextImpl.java    From Tomcat8-Source-Read with MIT License 4 votes vote down vote up
@Override
public void initialize(Servlet servlet, ServletRequest request,
        ServletResponse response, String errorPageURL,
        boolean needsSession, int bufferSize, boolean autoFlush)
        throws IOException {

    // initialize state
    this.servlet = servlet;
    this.config = servlet.getServletConfig();
    this.context = config.getServletContext();
    this.errorPageURL = errorPageURL;
    this.request = request;
    this.response = response;

    // initialize application context
    this.applicationContext = JspApplicationContextImpl.getInstance(context);

    // Setup session (if required)
    if (request instanceof HttpServletRequest && needsSession)
        this.session = ((HttpServletRequest) request).getSession();
    if (needsSession && session == null)
        throw new IllegalStateException(
                "Page needs a session and none is available");

    // initialize the initial out ...
    depth = -1;
    if (bufferSize == JspWriter.DEFAULT_BUFFER) {
        bufferSize = Constants.DEFAULT_BUFFER_SIZE;
    }
    if (this.baseOut == null) {
        this.baseOut = new JspWriterImpl(response, bufferSize, autoFlush);
    } else {
        this.baseOut.init(response, bufferSize, autoFlush);
    }
    this.out = baseOut;

    // register names/values as per spec
    setAttribute(OUT, this.out);
    setAttribute(REQUEST, request);
    setAttribute(RESPONSE, response);

    if (session != null)
        setAttribute(SESSION, session);

    setAttribute(PAGE, servlet);
    setAttribute(CONFIG, config);
    setAttribute(PAGECONTEXT, this);
    setAttribute(APPLICATION, context);

    isIncluded = request.getAttribute(
            RequestDispatcher.INCLUDE_SERVLET_PATH) != null;
}
 
Example 6
Source File: JspWriterImpl.java    From Tomcat7.0.67 with Apache License 2.0 4 votes vote down vote up
public JspWriterImpl() {
    super( Constants.DEFAULT_BUFFER_SIZE, true );
}
 
Example 7
Source File: PageContextImpl.java    From Tomcat7.0.67 with Apache License 2.0 4 votes vote down vote up
private void _initialize(Servlet servlet, ServletRequest request,
        ServletResponse response, String errorPageURL,
        boolean needsSession, int bufferSize, boolean autoFlush) {

    // initialize state
    this.servlet = servlet;
    this.config = servlet.getServletConfig();
    this.context = config.getServletContext();
    this.errorPageURL = errorPageURL;
    this.request = request;
    this.response = response;
    
    // initialize application context
    this.applicationContext = JspApplicationContextImpl.getInstance(context);

    // Setup session (if required)
    if (request instanceof HttpServletRequest && needsSession)
        this.session = ((HttpServletRequest) request).getSession();
    if (needsSession && session == null)
        throw new IllegalStateException(
                "Page needs a session and none is available");

    // initialize the initial out ...
    depth = -1;
    if (bufferSize == JspWriter.DEFAULT_BUFFER) {
        bufferSize = Constants.DEFAULT_BUFFER_SIZE;
    }
    if (this.baseOut == null) {
        this.baseOut = new JspWriterImpl(response, bufferSize, autoFlush);
    } else {
        this.baseOut.init(response, bufferSize, autoFlush);
    }
    this.out = baseOut;

    // register names/values as per spec
    setAttribute(OUT, this.out);
    setAttribute(REQUEST, request);
    setAttribute(RESPONSE, response);

    if (session != null)
        setAttribute(SESSION, session);

    setAttribute(PAGE, servlet);
    setAttribute(CONFIG, config);
    setAttribute(PAGECONTEXT, this);
    setAttribute(APPLICATION, context);

    isIncluded = request.getAttribute(
            RequestDispatcher.INCLUDE_SERVLET_PATH) != null;
}
 
Example 8
Source File: JspWriterImpl.java    From tomcatsrc with Apache License 2.0 4 votes vote down vote up
public JspWriterImpl() {
    super( Constants.DEFAULT_BUFFER_SIZE, true );
}
 
Example 9
Source File: PageContextImpl.java    From tomcatsrc with Apache License 2.0 4 votes vote down vote up
private void _initialize(Servlet servlet, ServletRequest request,
        ServletResponse response, String errorPageURL,
        boolean needsSession, int bufferSize, boolean autoFlush) {

    // initialize state
    this.servlet = servlet;
    this.config = servlet.getServletConfig();
    this.context = config.getServletContext();
    this.errorPageURL = errorPageURL;
    this.request = request;
    this.response = response;
    
    // initialize application context
    this.applicationContext = JspApplicationContextImpl.getInstance(context);

    // Setup session (if required)
    if (request instanceof HttpServletRequest && needsSession)
        this.session = ((HttpServletRequest) request).getSession();
    if (needsSession && session == null)
        throw new IllegalStateException(
                "Page needs a session and none is available");

    // initialize the initial out ...
    depth = -1;
    if (bufferSize == JspWriter.DEFAULT_BUFFER) {
        bufferSize = Constants.DEFAULT_BUFFER_SIZE;
    }
    if (this.baseOut == null) {
        this.baseOut = new JspWriterImpl(response, bufferSize, autoFlush);
    } else {
        this.baseOut.init(response, bufferSize, autoFlush);
    }
    this.out = baseOut;

    // register names/values as per spec
    setAttribute(OUT, this.out);
    setAttribute(REQUEST, request);
    setAttribute(RESPONSE, response);

    if (session != null)
        setAttribute(SESSION, session);

    setAttribute(PAGE, servlet);
    setAttribute(CONFIG, config);
    setAttribute(PAGECONTEXT, this);
    setAttribute(APPLICATION, context);

    isIncluded = request.getAttribute(
            RequestDispatcher.INCLUDE_SERVLET_PATH) != null;
}
 
Example 10
Source File: JspWriterImpl.java    From packagedrone with Eclipse Public License 1.0 4 votes vote down vote up
public JspWriterImpl() {
super( Constants.DEFAULT_BUFFER_SIZE, true );
   }
 
Example 11
Source File: JspWriterImpl.java    From Tomcat7.0.67 with Apache License 2.0 2 votes vote down vote up
/**
 * Create a buffered character-output stream that uses a default-sized
 * output buffer.
 *
 * @param  response  A Servlet Response
 */
public JspWriterImpl(ServletResponse response) {
    this(response, Constants.DEFAULT_BUFFER_SIZE, true);
}
 
Example 12
Source File: JspWriterImpl.java    From tomcatsrc with Apache License 2.0 2 votes vote down vote up
/**
 * Create a buffered character-output stream that uses a default-sized
 * output buffer.
 *
 * @param  response  A Servlet Response
 */
public JspWriterImpl(ServletResponse response) {
    this(response, Constants.DEFAULT_BUFFER_SIZE, true);
}
 
Example 13
Source File: JspWriterImpl.java    From packagedrone with Eclipse Public License 1.0 2 votes vote down vote up
/**
 * Create a buffered character-output stream that uses a default-sized
 * output buffer.
 *
 * @param  response  A Servlet Response
 */
public JspWriterImpl(ServletResponse response) {
    this(response, Constants.DEFAULT_BUFFER_SIZE, true);
}