Hi all,
 
Is there any easy way to get the application or session context from within a bean that is invoked from a JSP page?  I know that I can make get and set methods in the bean and then have the JSP page set them that way, but what I'm trying to do is make session beans that don't have to be initialized in every JSP page.  Ideally what I'd like is an extension to the JSP engine that always sets a session and application variable in a bean if a newly instantiated bean. 
 
The reason is, in my app I have 4 different beans that can be used in a number of combinations amongst 50 or so JSP pages, and I don't want to put java code into every one that checks if the bean is new and then initializes it.  I thought about extending the JspInit method to initialize my beans, but then that means that the JspInit method has to be aware of each bean that the Jsp page is going to ask for.  I'm into murky waters here with my understanding of JspInit and such- can what I want to do be done?
 
BTW I'm using JSP 1.0.
 
Thanks!

Reply via email to