Package javax.servlet

Examples of javax.servlet.ServletResponse


           
        };
        // Add some parameters to test passthrough
        String [] fooParams = {"bar"};
        request.getParameterMap().put("foo", fooParams);
        ServletResponse response = new MockHttpServletResponse();
        FilterChain chain = new FilterChain()
        {

            public void doFilter(ServletRequest request, ServletResponse response)
                    throws IOException, ServletException
View Full Code Here


    }

    @Override
    public void doFilter(ServletRequest request, ServletResponse response, FilterChain filterChain) throws ServletException, IOException {
        ServletRequest subSessionRequest = request;
        ServletResponse subSessionResponse = response;
        ServletRequestAttributes attributes = null;
        if (request instanceof HttpServletRequest) {
            HttpServletRequest httpRequest = (HttpServletRequest) request;
            attributes = new ServletRequestAttributes(httpRequest);
            setContext(httpRequest, attributes);
View Full Code Here

    /**
     * Unwrap back to the original container allocated response object
     */
    protected WinstoneResponse getUnwrappedResponse(ServletResponse response) {
        ServletResponse workingResponse = response;
        while (workingResponse instanceof ServletResponseWrapper) {
            workingResponse = ((ServletResponseWrapper) workingResponse).getResponse();
        }
        return (WinstoneResponse) workingResponse;
    }
View Full Code Here

        log.servletRequestDestroyed(e.getServletRequest());
        requestCtx.set(null);
    }

    protected void responseInitialized(@Observes @Initialized final InternalServletResponseEvent e) {
        ServletResponse res = e.getServletResponse();
        log.servletResponseInitialized(res);
        if (res instanceof HttpServletResponse) {
            requestCtx.set(new HttpServletRequestContext(requestCtx.get().getRequest(), res));
        } else {
            requestCtx.set(new ServletRequestContext(requestCtx.get().getRequest(), res));
View Full Code Here

 
    public static void setResponseLocale(PageContext pageContext, Locale locale)
    throws JspException
  {

    ServletResponse response = pageContext.getResponse();

    response.setLocale(locale);

    HttpSession session = pageContext.getSession();
    if (session != null)
      CoreSetTag.setValue(pageContext,
                          "javax.servlet.jsp.jstl.fmt.request.charset",
                          "session",
                          response.getCharacterEncoding());

  }
View Full Code Here

      log.fine(this + " cron");

      FilterChain chain = createServletChain();

      ServletRequest req = new StubServletRequest();
      ServletResponse res = new StubServletResponse();

      chain.doFilter(req, res);
    } catch (Throwable e) {
      log.log(Level.WARNING, e.toString(), e);
    } finally {
View Full Code Here

    HttpServletResponse parentRes;
    ServletResponseWrapper resWrapper = null;

    if (topResponse instanceof ServletResponseWrapper) {
      ServletResponse response = topResponse;

      while (response instanceof ServletResponseWrapper) {
        resWrapper = (ServletResponseWrapper) response;

        response = ((ServletResponseWrapper) response).getResponse();
View Full Code Here

      return false;
  }

  public CauchoResponse getCauchoResponse()
  {
    ServletResponse response = getResponse();

    if (response instanceof CauchoResponse)
      return (CauchoResponse) response;
    else
      return null;
View Full Code Here

  }
 
  public void close()
    throws IOException
  {
    ServletResponse response = getResponse();

    AbstractResponseStream responseStream = _responseStream;
    _responseStream = _originalResponseStream;

    if (responseStream != null)
View Full Code Here

  public void start()
  {
    if (_os != null || _writer != null)
      throw new IllegalStateException();

    ServletResponse next = _response.getResponse();
    if (next == null)
      throw new NullPointerException();
   
    if (next instanceof CauchoResponse) {
      CauchoResponse cNext = (CauchoResponse) next;

      if (cNext.isCauchoResponseStream())
        _stream = cNext.getResponseStream();
    }

    _isCommitted = false;
    _headerKeys.clear();
    _headerValues.clear();

    super.start();

    // server/053n
    try {
      setEncoding(next.getCharacterEncoding());
    } catch (Exception e) {
      log.log(Level.WARNING, e.toString(), e);
    }
  }
View Full Code Here

TOP

Related Classes of javax.servlet.ServletResponse

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.