[opencms-dev] opencms 6 | where to put class files

Jonathan Woods jonathan.woods at scintillance.com
Tue Mar 14 18:22:44 CET 2006


Joachim -
 
The question is made more complicated by the status of your module.  If
you're developing it from scratch, and just putting JSP, XSD, HTML and Java
(class) files underneath /system/modules in directories following the normal
OpenCms module structure, that's fine - but until you tell OpenCms
'officially' that it's a module, it won't put the /system/modules/<your
module name>/classes directory in the runtime classpath - so your classes
won't be found.  Same goes for jar files in /system/modules/<your module
name>/lib.
 
I think the best way to develop your module is to put your class files in
<opencms root>/WEB-INF/classes, which is always in the OpenCms classpath;
then once things are stable and you are ready to package up your module as a
module, you can put them instead in the directory above.  Other people may
have different ways of working.
 
Tip: beware old versions of your classes being picked up from odd places.
I'd suggest including a build timestamp in your Java code and spitting it
out in the log or in a test area of your web pages, just so you can be sure
new stuff is being picked up; and of course if OpenCms has already loaded a
class then you'll need to restart Tomcat for it to pick up any new version.
 
Jon
 
  _____  

From: opencms-dev-bounces at opencms.org
[mailto:opencms-dev-bounces at opencms.org] On Behalf Of Panos Kavalagios
Sent: 14 March 2006 15:48
To: The OpenCms mailing list
Subject: Re: [opencms-dev] opencms 6 | where to put class files


Joachim,

    You can either place your class file in:

my.mod.submodule/classes/my/mod/submodule

or as a jar file in:

my.mod.submodule/lib

Regards,
Panos

Joachim Zittmayr wrote: 

hello ocms.dev.list!



where do i have to put (new) class files?

can i put them just under a module classes folder (e.g.

my.mod.submodule/classes/classname.class)?

what else do i have to consider? it seems as if the newly created class

is not "recognized". i added a method, but i can't use it in a e.g.

jsp-template (method foo(String) is undefined for the type bar)



thanks 4 ur help!

joachim

  


-- 

Panagiotis Th. Kavalagios

Electrical & Computer Engineer

European Dynamics S.A.

Athens, Hellas

Tel: +30-210-8094500
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://webmail.opencms.org/pipermail/opencms-dev/attachments/20060314/98bcb90d/attachment.htm>


More information about the opencms-dev mailing list