permaculture playing cards*
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 Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » Servlets
Bookmark "If-Modified-Since" Watch "If-Modified-Since" New topic


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)
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.
I agree. Here's the link:
subject: If-Modified-Since
Similar Threads
About websphere xa datasource
Ajax not getting fired sometimes
Basic assignments fun fun
Database Connection and Operations
Action class not executing via AJAX.