Thanks Jon.
What I am trying to accomplish is implementing the Last-Modified /
If-Modified-Since logic. Where I would tag responses with a uniform
"Last-Modified" header for all resources/representations and when a request
comes in with a "If-Modified-Since" header I'd send appropriate HTTP 304
response or completely process the response.
Ideas/Best Practices to accomplish this without having to get the
HttpServletRequest/Response objects to do this would be great
> Hi Sherif,
>
> For custom headers whatever name you give, "entity.modificationDate",
> will be used.
>
> However, what you probably meant to do is use setModificationDate(new
> Date()) on the entity/response representation. ie.
> representation.setModificationDate(new Date());
>
> Jon
>
> Sherif Ahmed wrote:
> > I've been trying to add Last-Modified Header via the following code in a
> > Filter afterHandle method
> >
> > Form responseHeaders = (Form)
> > response.getAttributes().get("org.restlet.http.headers");
> >
> > if (responseHeaders == null)
> > {
> > responseHeaders = new Form();
> > response.getAttributes().put("org.restlet.http.headers",
> > responseHeaders);
> > }
> > responseHeaders.add("entity.modificationDate", "Sun, 06 Nov 2005 14:59:42
> > GMT");
> >
> >
> > However the header in the HTTP Response is not "Last-Modified" as I would
> > have expected, rather a custom header
> >
> > "entity.modificationDate: Sun, 06 Nov 2005 14:59:42 GMT"
> >
> > Quick response would be much appreciated
> >
> > ------------------------------------------------------
> > http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447&dsMessageId=2360858
> >
------------------------------------------------------
http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447&dsMessageId=2360959