Hi,
Can anyone help me with the following (related) problems.
I inherited a JSP-based application (no servlets, no beans) which uses in
many places a Java class (Config.java) which wraps a configuration file that
looks like this:
fileroot=http://192.125.105.160/
mailhost=http://192.125.105.110/mail/
...
This Config class is used by other classes (implementing the Application
logic) and is used in the JSPs by accessing the class method 'getInfo()' in
this way:
<%= PackageName.Config.getInfo("fileroot") %>
1. My first problem (more a Java problem than a JSP one) concerns the
Config.java class. It seems to me that this class should be implemented as a
singleton class (its unique instance represents a singular entity in the
system) but this seems to add a overhead (avoiding its garbage-collection).
Any suggestion?
2. In the new design of the application (in which I want to separate the
different -MVC - logics), I am still wandering if I can wrap the Config
class (as it stands) as a JavaBean, and use it in both JSP files and Java
classes. Knowing that in the JSPs only one method (getInfo()) will be used,
what would be the best solution?
3. If the answer to my first problem is that the Config.java should be a
singleton, how can I do if I want to wrap it as a bean?
I would like to avoid having in my JSPs something like this:
<%= PackageName.Config.getInstance().getInfo("fileroot") %>
Hope this is clear enough.
Thanks in advance.
Jimmy.
______________________________________________________
Get Your Private, Free Email at http://www.hotmail.com
===========================================================================
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
FAQs on JSP can be found at:
http://java.sun.com/products/jsp/faq.html
http://www.esperanto.org.nz/jsp/jspfaq.html