Demos and Usage of javax.servlet.http.HttpServletResponse.setDateHeader(String name,long date)


   1:     public int doEndTag() throws JspException {
   2:         HttpServletResponse response = 
   3:         ...
   4:             (HttpServletResponse) pageContext.getResponse();
   5:         response.addHeader("Pragma", "No-Cache");
   6:         ...
   7:     response.addHeader("Cache-Control", "pre-check=0, post-check=0");
   8:         response.setDateHeader("Expires", 0);
   9:         return EVAL_PAGE;

View Full Code Here
   1: 
   2: public void doGet(HttpServletRequest request, HttpServletResponse response) 
   3:         throws IOException
   4:         ...
   5:     response.setHeader("Cache-Control", "no-cache");
   6:     response.setDateHeader("Expires", 0);
   7: 
   8:     ServletOutputStream out = response.getOutputStream();
   9:     out.println(content);

View Full Code Here
   1: 
   2: public void doGet(HttpServletRequest request, HttpServletResponse response) 
   3:         throws IOException{
   4:         ...
   5:     response.setHeader("Cache-Control", "no-cache");
   6:     response.setDateHeader("Expires", 0);
   7: 
   8:         ...
   9: 
  10: public void doPost(HttpServletRequest request, HttpServletResponse response)
  11:     throws ServletException, IOException

View Full Code Here
   1: 
   2: public void doGet(HttpServletRequest request, HttpServletResponse response) 
   3:         throws IOException{
   4:         ...
   5:     response.setHeader("Cache-Control", "no-cache");
   6:     response.setDateHeader("Expires", 0);
   7: 
   8:     ServletOutputStream out = response.getOutputStream();
   9:     out.println(content);

View Full Code Here
   1: 
   2: public void doGet(HttpServletRequest req, HttpServletResponse res) 
   3:         throws ServletException, IOException 
   4:         ...
   5:     res.setHeader("Cache-Control", "no-cache");
   6:     res.setDateHeader("Expires", 0);
   7: 
   8:     PrintWriter out = res.getWriter();
   9:     out.println("<html><head><title>WASDG Title Page</title></head><body> &nbsp;<center><table BORDER=0 CELLPADDING=2 ><tr><td></td>");

View Full Code Here
   1: 
   2: public void doGet(HttpServletRequest request, HttpServletResponse response) 
   3:         throws IOException{
   4:         ...
   5:     response.setHeader("Cache-Control", "no-cache");
   6:     response.setDateHeader("Expires", 0);
   7: 
   8:         ...
   9: 
  10: public void doPost(HttpServletRequest request, HttpServletResponse response) 
  11:         throws IOException{
  12:         ...
  13:     response.setHeader("Cache-Control", "no-cache");
  14:     response.setDateHeader("Expires", 0);

View Full Code Here
   1: 
   2: public void doGet(HttpServletRequest request, HttpServletResponse response) 
   3:         throws ServletException, IOException {
   4:         ...
   5:     response.setHeader("Cache-Control", "no-cache");
   6:     response.setDateHeader("Expires", 0);
   7: 
   8:         ...
   9: 
  10: public void doPost(HttpServletRequest request, HttpServletResponse response)
  11:               throws ServletException, IOException

View Full Code Here
   1: {
   2:     public void service(HttpServletRequest request, HttpServletResponse response)
   3:         throws ServletException, IOException
   4:         ...
   5:         response.setHeader("Cache-Control", "no-cache");
   6:         response.setDateHeader("Expires", 0);
   7: 
   8:         out.println("<html><head><title>WASDG, BRUTE-CONNECTION</title></head>" + "<body><h1>Brute Connection</h1>" + "<p>");
   9:         

View Full Code Here
   1: import javax.servlet.http.HttpServletRequest;
   2: import javax.servlet.http.HttpServletResponse;
   3: import java.io.IOException;
   4:         ...
   5: 
   6:         if (servletResponse instanceof HttpServletResponse) {
   7:         ...
   8:             HttpServletResponse httpServletResponse = (HttpServletResponse) servletResponse;
   9:             HttpServletRequest req = (HttpServletRequest) servletRequest;
  10:         ...
  11:                 httpServletResponse.setHeader("Pragma", "no-cache");
  12:                 httpServletResponse.setDateHeader("Expires", 0L);

View Full Code Here
   1: import javax.servlet.http.HttpServletRequest;
   2: import javax.servlet.http.HttpServletResponse;
   3: import javax.swing.ImageIcon;
   4:         ...
   5: 
   6:     public void doGet(HttpServletRequest request, HttpServletResponse response)
   7:         throws ServletException, IOException {
   8:         ...
   9:         }
  10:         response.setDateHeader("Expires", -1);
  11:         ImageIcon imageIcon = new ImageIcon(iconTip.getImageData());

View Full Code Here
   1:   public void service (HttpServletRequest request,
   2:                          HttpServletResponse response)  throws
   3:     ServletException, IOException
   4:         ...
   5:     response.setHeader ("Cache-Control", "no-cache");
   6:     response.setDateHeader("Expires", 0);
   7:     String content =
   8:       "<html><head><title>WASDG - Common Form Information</title></head>" +
   9:       "<body bgcolor=\"white\"><h1>Form Information</h1>" +

View Full Code Here
   1: import javax.servlet.http.HttpServletRequest;
   2: import javax.servlet.http.HttpServletResponse;
   3: import javax.swing.ImageIcon;
   4:         ...
   5: 
   6:     public void doGet(HttpServletRequest request, HttpServletResponse response)
   7:         throws ServletException, IOException {
   8:         ...
   9:         }
  10:         response.setDateHeader("Expires", -1);
  11:         ImageIcon imageIcon = new ImageIcon(iconTip.getImageData());

View Full Code Here
   1: import javax.servlet.http.HttpServletRequest;
   2: import javax.servlet.http.HttpServletResponse;
   3: 
   4:         ...
   5:                                        HttpServletRequest request,
   6:                                        HttpServletResponse response)
   7:             throws Exception {
   8:         ...
   9:                                           HttpServletRequest request,
  10:                                           HttpServletResponse response)
  11:             throws Exception;
  12:         ...
  13:         response.setHeader("Pragma", "No-cache");
  14:         response.setDateHeader("Expires", 0);

View Full Code Here
   1: 
   2:     public void doGet(HttpServletRequest request, HttpServletResponse response) 
   3:         throws ServletException, IOException 
   4:         ...
   5:         response.setHeader("Cache-Control", "no-cache");
   6:         response.setDateHeader("Expires", 0);
   7: 
   8:         ...
   9: 
  10:     public void doPost(HttpServletRequest request, HttpServletResponse response) 
  11:         throws IOException

View Full Code Here
   1: 
   2: import javax.servlet.http.HttpServletResponse;
   3: import javax.servlet.jsp.JspWriter;
   4:         ...
   5:             if(useHeaders) {
   6:                 HttpServletResponse res = 
   7:         ...
   8:                     (HttpServletResponse)pageContext.getResponse();
   9:                 if(res.isCommitted()) {
  10:         ...
  11:                 res.setHeader("Pragma", "no-cache");
  12:                 res.setDateHeader("Expires", 0);

View Full Code Here