[opencms-dev] Can we add the HTTP Last-Modified attribute?

Prestel, Marianne prestel at itiv.uni-karlsruhe.de
Mon Jul 1 17:06:26 CEST 2002


Hi Stephan, hi List,

we have tried to include the modification date of resources (as
part of the contenttemplate) corresponding Stephan's suggestion (the code
stated below). But it doesn't work: how can we call the method in the
template (e.g. <method name="getLastModified"/>)?
Have anyone else tried to do this? Or any other solutions?

Thanks and regards
Marianne

-----Ursprüngliche Nachricht-----
Von: Stephan Hartmann [mailto:hartmann at waehrisch-feykes.de]
Gesendet: Dienstag, 11. Juni 2002 12:12
An: opencms-dev at www.opencms.org
Betreff: Re: [opencms-dev] Can we add the HTTP Last-Modified attribute?


Hello,

i think you could easyly do this by adding this before the return of method 
getContent of the Class com.opencms.template.CmsXmlTemplate:

String requestUri = cms.getRequestContext().getUri();
long lDate = cms.readFileHeader(requestUri).getDateLastModified();
cms.getRequestContext().getResponse().setLastModified(lDate);


i don't know if it will work so let me know it.

Bye,
Stephan




More information about the opencms-dev mailing list