Exemplo n.º 1
0
  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));
  }
Exemplo n.º 2
0
 /** Create header for testHeaderGreaterThan method test. */
 public void beginHeaderGreaterThan(WebRequest testRequest) {
   testRequest.addHeader(HEADER_KEY, GREATER_VAL);
 }
Exemplo n.º 3
0
 /** 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");
 }
Exemplo n.º 4
0
 /** "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");
 }
Exemplo n.º 5
0
 public void beginAccept6(WebRequest theRequest) {
   theRequest.addHeader("Accept", "text/html, application/xhtml+xml; q=0.5");
 }