tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Matt Goss <mg...@rtci.com>
Subject Re: Use a jsp:useBean Bean from a servlet?
Date Wed, 19 Jul 2000 13:22:53 GMT
Christian,
In order to use a bean with session scope you will need to add it to the
session object.
ie:
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

Christian.Menzel@GIquadrat.de 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
>

Mime
View raw message