I apologize if people are getting this posting a second time. My first
attempt appears to have failed on account of a bad sender's email
address.
Hello All:
I'm attempting move from a pure servlet based system ( running on JWS )
to a JSP based front end using WebLogic4.5.1 as my Web-enabled App
server. Given several business pressures, I'm diving into this effort
without properly understanding all the relevant issues in making this
transition. I hope I can leverage the vast collective experience that
this group has to offer. Here is my problem...
* My old system uses the MVC design pattern extensively. The servlets
are the controllers and every page that I serve is generated by a
team of models and renderers, with models encapsulating the
business logic and DB access and the renderers scripting HTML and
managing cookies and so on.
* Given my need for better decoupling between the content generation
and the business logic, I decided to replace the rendering side of
the architecture with JSPs.
* I also decided to do away with the servlets and placed all the
controlling logic in the JSPs too. Maybe not a wise choice but my
thinking is that this can be changed in due course.
* The plan is to reuse my models as that is production quality code
that supports our current site ( www.biddersedge.com )
* One of things I do is to initialize DB, Search engine connection
pools and various other Webserver wide services **ONCE** per
lifetime of the Webserver in a InitServlet. The lot of services are
singleton objects. This guaranteed that all other downstream
servlets and objects had access to essential services to do their
job with a convenient calling metaphor.
* This idiom is not working out very well in WebLogic JSP. The app
server instantiates new classloaders at different points in time
making my static singletons disappear. So instead of just
instantiating the pools once and only once I seem to have to do
often, which obviously is unacceptable. To help me continue my
development, I created an init.jsp file that I include at the top
of all my top level JSP files.
* This init.jsp has a synchronized static flag that keep track of the
"init" state of the JSP files and reinitialized the pool if
necessary. While this help me continue my development, I have to
come up with a better solution.
* The old InitServlet I used to use, apparently gets loaded with a
different ClassLoader , and doesn't work for my JSP files. It,
however, works fine for the other servlets.
What are my options here? Is there a design pattern that you know of
that will work in this situation? I have WebLogic guys also working on
this, but am interested in hearing from you.
Thanks
Girish Haran
Member of Tech Staff
Bidder's Edge Inc.
===========================================================================
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