Package javax.servlet.http

Examples of javax.servlet.http.HttpServletResponse.addHeader()


    int size = _headerList.size();
   
    for (int i = 0; i < size; i++) {
      Header header = _headerList.get(i);

      res.addHeader(header.getName(), header.getValue());
    }

    nextFilter.doFilter(request, response);
  }
 
View Full Code Here


      new MethodOverrideRequestWrapper(
        (HttpServletRequest) request),
        response);
   
    HttpServletResponse hresponse = (HttpServletResponse) response;
    hresponse.addHeader("Vary", "X-HTTP-Method-Override");
  }

  public void init(FilterConfig config) throws ServletException {
    String param = config.getInitParameter(METHODS);
    if (param != null) {
View Full Code Here

        String header = request.getHeader( "Proxy-Authorization" );
        if ( header == null )
        {
            response.setStatus( HttpServletResponse.SC_PROXY_AUTHENTICATION_REQUIRED );
            response.addHeader( "Proxy-Authenticate", "Basic realm=\"Squid proxy-caching web server\"" );
            return;
        }
        else
        {
            String data = header.substring( "BASIC ".length() );
View Full Code Here

    String uri = hreq.getRequestURI();


    // Set cache headers for GWT cache, 1 year, could be forever
    if (uri.indexOf(CACHE) != -1) {
      hres.addHeader("Cache-Control", "max-age=31556926, public");
    }
    // cache for 1 hour
    if (uri.endsWith(IMAGE_PNG) || uri.endsWith(IMAGE_GIF) || uri.endsWith(IMAGE_JPG)) {
      hres.addHeader("Cache-Control", "max-age=3600, public");
    }
View Full Code Here

    if (uri.indexOf(CACHE) != -1) {
      hres.addHeader("Cache-Control", "max-age=31556926, public");
    }
    // cache for 1 hour
    if (uri.endsWith(IMAGE_PNG) || uri.endsWith(IMAGE_GIF) || uri.endsWith(IMAGE_JPG)) {
      hres.addHeader("Cache-Control", "max-age=3600, public");
    }
    // cache for 1 hour
    if (uri.endsWith(FILE_CSS)) {
      // cache for one hour
      hres.addHeader("Cache-Control", "max-age=3600, private");
View Full Code Here

      hres.addHeader("Cache-Control", "max-age=3600, public");
    }
    // cache for 1 hour
    if (uri.endsWith(FILE_CSS)) {
      // cache for one hour
      hres.addHeader("Cache-Control", "max-age=3600, private");
    }

    chain.doFilter(request, response);
  }
View Full Code Here

            if (req.getContentType() != null && req.getContentType().startsWith("multipart/form-data")) {
                req.setAttribute(JETTY_MULTIPART_CONFIG_ELEMENT, MULTI_PART_CONFIG);
            }

            HttpServletResponse httpResponse = (HttpServletResponse) resp;
            httpResponse.addHeader("Accept-Ranges", "bytes");
            app.handle((HttpServletRequest) req, httpResponse);
        } catch (Exception e) {
            throw new ServletException(e);
        }
    }
View Full Code Here

  @Override
  public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain) throws IOException,
      ServletException {
    HttpServletResponse httpResponse = (HttpServletResponse) response;
    httpResponse.addHeader(HEADER_ALLOW_ORIGIN, "*");
    httpResponse.addHeader(HEADER_ALLOW_HEADERS, "Content-Type, X-Auth-Token");
    httpResponse.addHeader(HEADER_ALLOW_METHODS, "GET, POST, HEAD, OPTIONS, PUT");

    chain.doFilter(request, response);
  }
View Full Code Here

  @Override
  public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain) throws IOException,
      ServletException {
    HttpServletResponse httpResponse = (HttpServletResponse) response;
    httpResponse.addHeader(HEADER_ALLOW_ORIGIN, "*");
    httpResponse.addHeader(HEADER_ALLOW_HEADERS, "Content-Type, X-Auth-Token");
    httpResponse.addHeader(HEADER_ALLOW_METHODS, "GET, POST, HEAD, OPTIONS, PUT");

    chain.doFilter(request, response);
  }

View Full Code Here

  public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain) throws IOException,
      ServletException {
    HttpServletResponse httpResponse = (HttpServletResponse) response;
    httpResponse.addHeader(HEADER_ALLOW_ORIGIN, "*");
    httpResponse.addHeader(HEADER_ALLOW_HEADERS, "Content-Type, X-Auth-Token");
    httpResponse.addHeader(HEADER_ALLOW_METHODS, "GET, POST, HEAD, OPTIONS, PUT");

    chain.doFilter(request, response);
  }

  @Override
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.