File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Servlets and the fly likes If-Modified-Since Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of OCA/OCP Java SE 7 Programmer I & II Study Guide this week in the OCPJP forum!
JavaRanch » Java Forums » Java » Servlets
Bookmark "If-Modified-Since" Watch "If-Modified-Since" New topic
Author

If-Modified-Since

Drew Lane
Ranch Hand

Joined: May 13, 2001
Posts: 296
I'm trying to figure out how to get the server to return a 304 NOT MODIFIED response code in reply to this request from the client:
connection.setRequestProperty("If-Modified-Since","Sat, 29 Oct 2004 19:43:31 GMT");
Do I have the syntax correct? (The date format is pretty nasty)
Thanks,
Drew
Steve Leach
Ranch Hand

Joined: Sep 24, 2003
Posts: 46
Don't you just use response.setStatus(304) ?
Drew Lane
Ranch Hand

Joined: May 13, 2001
Posts: 296
Oh, I figured out the problem.
The date I was using to test with was after the servers system time, so it was invalid. Go figure.
Sorry if this was a bit OT.
Drew
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: If-Modified-Since