public void beginUserAgentNeedsUpdate2(WebRequest req) {
    long curTime = System.currentTimeMillis(), threeHoursAgo = curTime - 10800000L;
    facesService.setModificationTime("resources/duke-nv.gif", threeHoursAgo);
    facesService.setModificationTime("resources/nvLibrary/duke-nv.gif", threeHoursAgo);
    SimpleDateFormat format = new SimpleDateFormat(RFC1123_DATE_PATTERN, Locale.US);
    format.setTimeZone(GMT);
    Date headerValue = new Date(curTime);

    req.addHeader("If-Modified-Since", format.format(headerValue));
  }
Example #2
0
 /** Create header for testHeaderGreaterThan method test. */
 public void beginHeaderGreaterThan(WebRequest testRequest) {
   testRequest.addHeader(HEADER_KEY, GREATER_VAL);
 }
 /** quality test - "text/x-dvi" wins */
 public void beginAccept2(WebRequest theRequest) {
   theRequest.addHeader("Accept", "text/plain; q=0.5, text/html, text/x-dvi; q=0.8, text/x-c");
 }
 /** "level" precedence test - "text/html;level=1" is higher than "text/html" */
 public void beginAccept3(WebRequest theRequest) {
   theRequest.addHeader("Accept", "text/plain; q=0.5, text/html, text/html;level=1");
 }
 public void beginAccept6(WebRequest theRequest) {
   theRequest.addHeader("Accept", "text/html, application/xhtml+xml; q=0.5");
 }