tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Matt Goss <>
Subject Re: Use a jsp:useBean Bean from a servlet?
Date Wed, 19 Jul 2000 13:22:53 GMT
In order to use a bean with session scope you will need to add it to the
session object.
to add:
HttpSession ses = request.getSession(true);
mybean mb = new mybean();
ses.putValue("mybean1", mb);

to get:
HttpSession ses = request.getSession(true);
mybean mb = (mybean) ses.getValue("mybean1");

hope this helps,
Matt Goss wrote:

> Hi,
> is it possible to access a via jsp:useBean generated bean with session
> scope in a servlet?
> In jsp servlets one can use the pageContext class.
> Is there any other way than to use the setAttribute/getAttribute?
> Thanks
> Christian Menzel

View raw message