tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Anja Beckmann <a.beckm...@datadesignag.com>
Subject AW: Bean Persistence
Date Fri, 01 Jun 2001 15:28:42 GMT
if you want the beans to have request scope you add them to the
servletrequest with setAttribute, for the session you add it to the session
object with setAttribute, if you want to add it to the application scope
then you write
          ServletContext sc = getServletContext();	   
          sc.setAttribute("beanname", bean);
when you retrieve the bean in the jsp you can do it with usebean.

-----Urspr√ľngliche Nachricht-----
Von: Sulman.Jeff@epamail.epa.gov [mailto:Sulman.Jeff@epamail.epa.gov]
Gesendet: Freitag, 1. Juni 2001 17:07
An: tomcat-user@jakarta.apache.org
Betreff: Bean Persistence


I am currently calling a servlet that retrieves data from a database and
sets the instance variables for a number of beans.
My question is how do I make the beans available to the JSP?  I know in a
JSP I can set the scope of a bean to the session so other JSPs and servlets
can access it.  How do it do it from the other direction from a servlet to
a JSP or other servlets?

Jeff Sulman

Mime
View raw message