[opencms-dev] Where to put Beans?

Jonathan Woods jonathan.woods at scintillance.com
Fri Nov 17 07:38:51 CET 2006


Chris -

1.  You don't need to use beans at all if you don't want to.  I use real
Java and JSP scriptlets almost exclusively, for example.

2.  The classpath in operation for OpenCms JSP pages includes class/ folders
'in modules' and JARs in lib/ folders 'in modules'.  'In modules' means
'contained in any folder called /system/modules/modulename'.  OpenCms trawls
through all module folders under /system/modules and ensures that at JSP
execution time, all such locations are part of the classpath.  I'm not sure
of the precise mechanism, but that's the effect of it.

3.  So to develop your own code, best to do so by putting classes and
libraries in /system/module/modulename - and then your stuff should be found
automagically.

Jon

-----Original Message-----
From: opencms-dev-bounces at opencms.org
[mailto:opencms-dev-bounces at opencms.org] On Behalf Of Christoph Werner
Sent: 16 November 2006 17:50
To: opencms-dev at opencms.org
Subject: [opencms-dev] Where to put Beans?

Hi!
I'm quite new to openCMS and JSP. So I worked through a JSP-Tutorial and got
stuck at the point where the use of beans is introduced.

To work with opsnCMS I created a folder in the Offline project and put all
files created while working on the tutorial in there. The really simple task
was to write a set of pages, which take the name of a system property from
the user, process it with a bean and present the result.

So far I have a HTML page asking for a property name, a JSP page receiving
the posted data and utilizing the bean and the bean itself as compiled
CLASS.

These are the JSP tags in the JSP page:

<jsp:useBean id="prop" class="PropData" scope="session" /> <jsp:setProperty
property="*" name="prop" />

This page issues an error message about using a ressource name, which could
not be resolved. Since the bean is PropData.class, I think the problem is
the location of the file.

I looked for answers to this question and found some messages in the
archive, but I didn't understand the answers.

One answer said: JARs go into the lib folder and CLASSES go into the classes
folder of my module under the appropriate tree. I don't have a module, so
what classes folder? I found one, but placing the class there didn't solve
the problem.

Biggest question in first place: Do I upload the class with the Webinterface
or do I have to use a FTP client?

Next question would be: Am I wrong in assuming, that the use of beans is
quite essential for developing openCMS pages/modules/etc. ?

I hope someone can help me.

Chris





More information about the opencms-dev mailing list