[opencms-dev] Where to put .html and .jsp files?

M Butcher mbutcher at grcomputing.net
Wed Jan 21 07:29:25 CET 2004


I'm sure there are differing philosophies on this, but I'll offer my 
interpretation of the OpenCms docs:

JSPs:

* Logic (e.g. scriptlets) should usually go in the elements/ directory 
of the module. It is probably wise to make sure you give them cache 
directives (set the cache property), since that will help them perform 
optimally. With logic separated into the module you will be able to 
accomplish three things: 1) keep code out of files that editors might 
see/edit/use, 2) make your scriptlets reusable (and more easy to track), 
3) keep the scriptlets easily exported. If you have separate dev and 
deployment platforms, this is pretty useful.

* Templates (obviously) go in the jsptemplates/ dir of the module.

* JSP pages (mainly using taglibs) can go in the regular content 
directory. For me, the idea is to configure the JSPs that appear along 
with regular content in such a way that a knowledgable editor (one who 
understands that <cms:*/> tags create dynamic content) can still handle 
text and formatting on these items.

Content (HTML):

* If the content is clearly part of the module (e.g. help text or README 
files and such), then it should stay in the module.

* If it is clearly content, it should go in with the rest of your content.

* If it is clearly content, but you want it to move with the module, you 
can configure the module to pack and unpack that content into a specific 
directory in the content area. Does that make sense? The OpenCms example 
module does this.

You may find another way to do this that works equally as well for you, 
but this way has worked for me.

Matt

Thomas Gagné wrote:
> I could put them in the module directory, but I'm thinking they ought to 
> go somewhere else.  Is that true?
> 
> _______________________________________________
> 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