[opencms-dev] Accessing file creation/modification date inside JSP-(Template)

Jörn Wohlrab jwohlrab at unilog.de
Tue Aug 12 14:15:02 CEST 2003


Matt,
your suggestion works fine. But in case of using a JSP template you get 
at least in the "online-project" the modification date of the template - 
not of the page itself .
A simliar solution wich comes around with this problem is:

String filename = cms.getRequestContext().getUri();
cms.getCmsObject().readFile(filename).getDateLastModified();

Greetings
--Joern

M Butcher schrieb:

>>From a CmsJspActionElement cms, you can get DateLastModified by doing
>this:
>
>
>cms.getCmsObject().readFile(filename).getDateLastModified();
>
>You can get the filename from 
>
>String filename =
>cms.getRequestContext().getRequest().getRequestedResource();
>
>though there are probably other ways of doing that.
>
>Matt
>
>On Fri, 2003-08-01 at 06:10, Jörn Wohlrab wrote:
>  
>
>>Ok, but how would the coding inside the JSP look like?
>>Could it be like ...
>><%
>>  CmsJspActionElement cms = new CmsJspActionElement(pageContext, 
>>request, response);
>>  cms.getCmsObject().???(??).getDateLastModified();
>><%>
>>Thank you for your fast response!
>>-- Joern
>>
>>Thomas März schrieb:
>>
>>    
>>
>>>Hello,
>>>
>>>Jörn Wohlrab <jwohlrab at unilog.de> writes:
>>> 
>>>
>>>      
>>>
>>>>is it possible to access the the creation and the modification
>>>>date/time of a page via JSP-Tag or JSP-scriptlet? We just want to add
>>>>   
>>>>
>>>>        
>>>>
>>>Yes, com.opencms.file.CmsResource.getDateLastModified().
>>>
>>>Best Regards,
>>>Thomas Maerz
>>>
>>>_______________________________________________
>>>This mail is send to you from the opencms-dev mailing list
>>>To change your list options, or to unsubscribe from the list, please visit
>>>http://mail.opencms.org/mailman/listinfo/opencms-dev
>>>
>>> 
>>>
>>>      
>>>
>>
>>_______________________________________________
>>This mail is send to you from the opencms-dev mailing list
>>To change your list options, or to unsubscribe from the list, please visit
>>http://mail.opencms.org/mailman/listinfo/opencms-dev
>>    
>>






More information about the opencms-dev mailing list