Package javax.servlet.http

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


      final HttpServletRequest hRequest = (HttpServletRequest) request;
      final HttpServletResponse hResponse = (HttpServletResponse) response;
      switch(getCacheStatus(hRequest.getRequestURL().toString())) {
        case CACHE_1YEAR:
          // the w3c spec requires a maximum age of 1 year
          hResponse.addHeader("Cache-Control", "max-age=31536000");
          hResponse.setDateHeader("Expires", System.currentTimeMillis() + 31536000000L);
          break;
        case CACHE_1DAY:
          hResponse.addHeader("Cache-Control", "max-age=86400");
          hResponse.setDateHeader("Expires", System.currentTimeMillis() + 86400000L);
View Full Code Here


          // the w3c spec requires a maximum age of 1 year
          hResponse.addHeader("Cache-Control", "max-age=31536000");
          hResponse.setDateHeader("Expires", System.currentTimeMillis() + 31536000000L);
          break;
        case CACHE_1DAY:
          hResponse.addHeader("Cache-Control", "max-age=86400");
          hResponse.setDateHeader("Expires", System.currentTimeMillis() + 86400000L);
          break;
        case NOCACHE:
          hResponse.addHeader("Cache-Control", "no-cache no-store must-revalidate");
          hResponse.addHeader("Pragma", "no-cache"); // HTTP/1.0
View Full Code Here

        case CACHE_1DAY:
          hResponse.addHeader("Cache-Control", "max-age=86400");
          hResponse.setDateHeader("Expires", System.currentTimeMillis() + 86400000L);
          break;
        case NOCACHE:
          hResponse.addHeader("Cache-Control", "no-cache no-store must-revalidate");
          hResponse.addHeader("Pragma", "no-cache"); // HTTP/1.0
          hResponse.setDateHeader("Expires", 0l);
          break;
      }
    }
View Full Code Here

          hResponse.addHeader("Cache-Control", "max-age=86400");
          hResponse.setDateHeader("Expires", System.currentTimeMillis() + 86400000L);
          break;
        case NOCACHE:
          hResponse.addHeader("Cache-Control", "no-cache no-store must-revalidate");
          hResponse.addHeader("Pragma", "no-cache"); // HTTP/1.0
          hResponse.setDateHeader("Expires", 0l);
          break;
      }
    }
    chain.doFilter(request, response);
View Full Code Here

                    return;
                }
            }

            // Proxy-Authenticate Basic realm="CCProxy Authorization"
            response.addHeader( "Proxy-Authenticate", "Basic realm=\"Jetty Proxy Authorization\"" );
            response.setStatus( HttpServletResponse.SC_PROXY_AUTHENTICATION_REQUIRED );
            return;
        }

        super.service( req, res );
View Full Code Here

      final HttpServletRequest hRequest = (HttpServletRequest) request;
      final HttpServletResponse hResponse = (HttpServletResponse) response;
      switch(getCacheStatus(hRequest.getRequestURL().toString())) {
        case CACHE_1YEAR:
          // the w3c spec requires a maximum age of 1 year
          hResponse.addHeader("Cache-Control", "max-age=31536000");
          hResponse.setDateHeader("Expires", System.currentTimeMillis() + 31536000000L);
          break;
        case CACHE_1DAY:
          hResponse.addHeader("Cache-Control", "max-age=86400");
          hResponse.setDateHeader("Expires", System.currentTimeMillis() + 86400000L);
View Full Code Here

          // the w3c spec requires a maximum age of 1 year
          hResponse.addHeader("Cache-Control", "max-age=31536000");
          hResponse.setDateHeader("Expires", System.currentTimeMillis() + 31536000000L);
          break;
        case CACHE_1DAY:
          hResponse.addHeader("Cache-Control", "max-age=86400");
          hResponse.setDateHeader("Expires", System.currentTimeMillis() + 86400000L);
          break;
        case NOCACHE:
          hResponse.addHeader("Cache-Control", "no-cache no-store must-revalidate");
          hResponse.addHeader("Pragma", "no-cache"); // HTTP/1.0
View Full Code Here

        case CACHE_1DAY:
          hResponse.addHeader("Cache-Control", "max-age=86400");
          hResponse.setDateHeader("Expires", System.currentTimeMillis() + 86400000L);
          break;
        case NOCACHE:
          hResponse.addHeader("Cache-Control", "no-cache no-store must-revalidate");
          hResponse.addHeader("Pragma", "no-cache"); // HTTP/1.0
          hResponse.setDateHeader("Expires", 0l);
          break;
      }
    }
View Full Code Here

          hResponse.addHeader("Cache-Control", "max-age=86400");
          hResponse.setDateHeader("Expires", System.currentTimeMillis() + 86400000L);
          break;
        case NOCACHE:
          hResponse.addHeader("Cache-Control", "no-cache no-store must-revalidate");
          hResponse.addHeader("Pragma", "no-cache"); // HTTP/1.0
          hResponse.setDateHeader("Expires", 0l);
          break;
      }
    }
    chain.doFilter(request, response);
View Full Code Here

    Environment environment = getCurrentEnvironment();
    Long id = recording.begin(delegate, environment, (HttpServletRequest) request);
    final HttpServletResponse innerResponse = (HttpServletResponse) response;
    final int[] responseCode = {0};

    innerResponse.addHeader(TRACE_HEADER_NAME,
        basePath + "details?time=" + id + "&type=json");

    InvocationHandler invocationHandler =  new InvocationHandler() {
      @Override
      public Object invoke(Object proxy, Method method, Object[] args) throws Throwable {
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.