Package javax.servlet.http

Examples of javax.servlet.http.HttpServletResponseWrapper


    }

    public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain) throws IOException, ServletException
    {
        HttpServletResponse servletResponse = (HttpServletResponse) response;
        HttpServletResponseWrapper responseWrapper = new HttpServletResponseWrapper(servletResponse)
        {

            /*
             * (non-Javadoc)
             * @see
 
View Full Code Here


           
            //Will stream updated response
            final ByteArrayOutputStream byteStream = new ByteArrayOutputStream();
           
            //Create a custom response wrapper to adding in the padding
            HttpServletResponseWrapper responseWrapper = new HttpServletResponseWrapper(httpResponse) {

                @Override
                public ServletOutputStream getOutputStream() throws IOException {
                    return new ServletOutputStream() {
                        @Override
View Full Code Here

  public boolean findComponent(InterceptorStack stack,
      final HttpServletRequest req, HttpServletResponse resp)
      throws ServletException, IOException {

    HttpServletResponseWrapper fake = new FourOFourResponseWrapper(req,
        (HttpServletResponse) resp);

    RequestUriParser parser = new RequestUriParser(req, fake, webComponent);

    URI base = parser.getBaseUri();
View Full Code Here

  protected void onSuccessfulAuthentication(HttpServletRequest request,
      HttpServletResponse response, Authentication authResult)
  throws IOException {
    super.onSuccessfulAuthentication(request, response, authResult);

    HttpServletResponseWrapper responseWrapper = new HttpServletResponseWrapper(response);

    Writer out = responseWrapper.getWriter();

    String targetUrl = determineTargetUrl( request );
    out.write("{success:true, targetUrl : \'" + targetUrl + "\'}");
    out.close();
View Full Code Here

  protected void onUnsuccessfulAuthentication( HttpServletRequest request,
      HttpServletResponse response, AuthenticationException failed )
  throws IOException {

    HttpServletResponseWrapper responseWrapper = new HttpServletResponseWrapper(response);

    Writer out = responseWrapper.getWriter();

    out.write("{ success: false, errors: { reason: 'Login failed. Try again.' }}");
    out.close();

  }
View Full Code Here

            }
        };
        final PrintWriter responseWriter = new PrintWriter(new OutputStreamWriter(responseStream));

        try {
            dispatcher.forward(requestProviderRef.get().get(), new HttpServletResponseWrapper(responseProviderRef.get().get()) {

                @Override
                public ServletOutputStream getOutputStream() throws IOException {
                    return responseStream;
                }
View Full Code Here

      percentMap.put(uid, 0);
      sessionsMap.put(uid, multipartRequest);
     
      if (multipartRequest.parseRequest()) {
          handleRequest(multipartRequest,  multipartRequest.isFormUpload() ? response :
            new HttpServletResponseWrapper(response){
            @Override
            public void setContentType(String type) {
              super.setContentType(BaseXMLFilter.TEXT_HTML + ";charset=UTF-8");
            }
          }, chain);
View Full Code Here

      chain.doFilter( request, wrapResponse( (HttpServletResponse) response ) );
   }
  
   private static ServletResponse wrapResponse(HttpServletResponse response)
   {
      return new HttpServletResponseWrapper(response)
      {
         @Override
         public void sendRedirect(String url) throws IOException
         {
            if ( Contexts.isEventContextActive() )
View Full Code Here

            }
        };
        final PrintWriter responseWriter = new PrintWriter(new OutputStreamWriter(responseStream, getEncoding()));

        try {
            wrapper.forward(requestProviderRef.get().get(), new HttpServletResponseWrapper(responseProviderRef.get().get()) {

                @Override
                public ServletOutputStream getOutputStream() throws IOException {
                    return responseStream;
                }
View Full Code Here

        RuntimeContext context = RuntimeContextTLS.getRuntimeContext();
        if (context == null) {
            throw new IllegalStateException();
        }

        HttpServletResponseWrapper wrapper =
            RuntimeContextTLS.getRuntimeContext().getAttribute(HttpServletResponseWrapper.class);
        if (wrapper == null) {
            throw new IllegalStateException();
        }
        return wrapper;
View Full Code Here

TOP

Related Classes of javax.servlet.http.HttpServletResponseWrapper

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.