What's the best way to access JSP intrinsic objects (request, response,
application, session) from a bean that's used by a JSP?

We're setting up an application with a JSP-bean-EJB architecture, where
the "JSP beans" hold most of the business logic and the EJBs are just
wrappers for stored procedures...it's a direct port of an ASP app, as a
first step in getting to a Java platform. Each JSP page uses beans to
access the EJB layer and uses setProperty to use request parameters to
set up the bean properties, but there are also application- and
session-level values and objects that the bean needs access to.

One solution that was suggested for application-level objects was to
create a singleton object to hold all those, but the problem there is
that it would need to be created on each JSP page that needs access to
the values/objects itself, or its methods would need to be echoed by
each "page bean". Another approach would be to pass the intrinsic
objects themselves into the bean somehow, most logically in the
constructor, and have the bean hold that reference, but it would seem to
lead to synchronization problems.

Anyone have any insights on using application, session, and others
inside beans like this? Or is it better to avoid the use of these, and
keep everything in server-side objects?

--
Jeff Sahol
[EMAIL PROTECTED]

===========================================================================
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
Some relevant FAQs on JSP/Servlets can be found at:

 http://java.sun.com/products/jsp/faq.html
 http://www.esperanto.org.nz/jsp/jspfaq.html
 http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
 http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets

Reply via email to