[opencms-dev] JSP template problem

Ivan Jelenic ivan.jelenic at nbs.yu
Thu Jun 12 10:26:01 CEST 2003


Hi,

I am using JSP template to build my html pages. In offline mode everything works fine. But when I publish them I see a system error! My problems begin when I add this code:

 // Create a string contains an owner of resource
CmsObject cmsObject =cms.getCmsObject();
CmsResource res=cmsObject.readFile(filename);   
String authorId=cmsObject.readOwner(res).getName();

//Translation of user_name to full name
Vector users = cmsObject.getUsers();
String author = "";
for (int i=0; i < users.size(); i++) {
 CmsUser user = (CmsUser) users.elementAt(i);
 if (user.getName().equals(authorId)) {
  author = author + user.getFirstname() + " " + user.getLastname();
 }
}

//Get last modified date for the requested page
Date dateOfLastChanged = new Date(res.getDateLastModified());
Calendar cal = Calendar.getInstance();
cal.setTime(dateOfLastChanged);
String lastModified=cal.get(Calendar.DAY_OF_MONTH)+"."+(cal.get(Calendar.MONTH)+1)+"."+cal.get(Calendar.YEAR);

Please help!
Best regards, Ivan.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.opencms.org/pipermail/opencms-dev/attachments/20030612/0cce5430/attachment.html>


More information about the opencms-dev mailing list