Package javax.servlet.http

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


    throws IOException, ServletException {
    HttpServletResponse httpRes = (HttpServletResponse) res;
    httpRes.setHeader("Cache-Control", "no-cache");
    long now = System.currentTimeMillis();
    httpRes.addDateHeader("Expires", now);
    httpRes.addDateHeader("Date", now);
    httpRes.addHeader("Pragma", "no-cache");
    chain.doFilter(req, res);
  }

  @Override
View Full Code Here


                    .getResponse();

            // Set headers to prevent browser caching, if appropriate
            if ((noCache != null) && noCache.equalsIgnoreCase("true"))
            {
                response.addDateHeader("expires", 1);
                response.addHeader("Pragma", "no-cache");
                response.addHeader("Cache-control", "no-store");
            }

            // Ensure the HTTP header will declare that UTF-8 is used
View Full Code Here

    public void prepareResponse()
    {
        HttpServletResponse response = getHttpServletResponse();
        response.addHeader("Cache-Control","no-store,no-cache,must-revalidate"); //HTTP 1.1
        response.addHeader("Pragma","no-cache"); //HTTP 1.0
        response.addDateHeader("Expires", 0); // Quiz�s tambi�n -1
        // response.addHeader("Expires", "Thu, 01 Jan 1970 01:00:00 GMT");
        // response.setHeader("Last-Modified", "FRI, JUN 26 3020 23:59:59 GMT"); // En el futuro

        // Es absolutamente vital no cachear, sobre todo en FireFox porque soluciona el problema del back/forward
        // que al volver ejecuta el evento load pero sin recargar la p�gina en el servidor
View Full Code Here

                       FilterChain chain)
    throws IOException, ServletException {
    HttpServletResponse httpRes = (HttpServletResponse) res;
    httpRes.setHeader("Cache-Control", "no-cache");
    long now = System.currentTimeMillis();
    httpRes.addDateHeader("Expires", now);
    httpRes.addDateHeader("Date", now);
    httpRes.addHeader("Pragma", "no-cache");
    chain.doFilter(req, res);
  }
View Full Code Here

    throws IOException, ServletException {
    HttpServletResponse httpRes = (HttpServletResponse) res;
    httpRes.setHeader("Cache-Control", "no-cache");
    long now = System.currentTimeMillis();
    httpRes.addDateHeader("Expires", now);
    httpRes.addDateHeader("Date", now);
    httpRes.addHeader("Pragma", "no-cache");
    chain.doFilter(req, res);
  }

  @Override
View Full Code Here

        HttpServletResponse httpServletResponse = (HttpServletResponse)servletResponse;

        httpServletResponse.setStatus(HttpServletResponse.SC_UNAUTHORIZED);
        httpServletResponse.addHeader("Server", "Airavata Server");
        httpServletResponse.addHeader("Description", message);
        httpServletResponse.addDateHeader("Date", Calendar.getInstance().getTimeInMillis());
        httpServletResponse.addHeader("WWW-Authenticate", "Basic realm=Airavata");
        httpServletResponse.setContentType("text/html");

    }
}
View Full Code Here

        if (response != null) {
            if (response.containsHeader(name)) {
                response.setDateHeader(name, value);
            }
            else {
                response.addDateHeader(name, value);
            }
        }
    }
   
    /**
 
View Full Code Here

        try
        {
            // Set headers to prevent browser caching, if appropriate
            if ((noCache != null) && noCache.equalsIgnoreCase("true"))
            {
                response.addDateHeader("expires", 1);
                response.addHeader("Pragma", "no-cache");
                response.addHeader("Cache-control", "no-store");
            }

            // Ensure the HTTP header will declare that UTF-8 is used
View Full Code Here

    {
        final HttpServletResponse httpResponse = response;

        final Calendar expiresCalendar = Calendar.getInstance();
        expiresCalendar.add(Calendar.MINUTE, minutes);
        httpResponse.addDateHeader("Expires", expiresCalendar.getTimeInMillis());
    }

    private Format getPersisterFormat(RequestModel requestModel)
    {
        return new Format(2, "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n"
View Full Code Here

            {
                final HttpServletResponse httpResponse = (HttpServletResponse) response;

                final Calendar expiresCalendar = Calendar.getInstance();
                expiresCalendar.add(Calendar.YEAR, expiresOffsetYears);
                httpResponse.addDateHeader("Expires", expiresCalendar.getTimeInMillis());
            }
        }

        chain.doFilter(request, response);
    }
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.