tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "KY K Lui" <kyluitomc...@mailcity.com>
Subject Re: use servlet context in a bean
Date Sun, 28 May 2000 00:05:12 GMT
thanks i got it .

my code is like this
<jsp:useBean id="beanid" class="beanclass" scope"session">
<% beanid.initialize(applicationbean); %>
</jsp:useBean>

sometimes it works very well but sometimes it doesn't.
is it a problem of tomcat ?
i am using apache and tomcat in linux.

does anyone has the same problem?

--

On Sat, 27 May 2000 10:03:09   Derek DeMoro wrote:
>No.  You should create a bean called "WebBean" or something to that nature.
>WebBean should have a method called initialize which initializes all the jsp
>objects
>in your bean so you can use them.
>
>Ex.
><jsp:useBean class="foo" id="f" scope="application">
></jsp:useBean>
>
><% f.initialize(application, session, request, response ,out); %>
>
>
>----- Original Message -----
>From: "KY K Lui" <kyluitomcat1@mailcity.com>
>To: <tomcat-dev@jakarta.apache.org>
>Sent: Saturday, May 27, 2000 9:21 AM
>Subject: use servlet context in a bean
>
>
>> i want to use bean in my jsp page.
>>
>> I have a application scope bean which has id="beanid"
>>
>> How can other bean access this application bean?
>> can i use "getServletContext().getAttribute("beanid");"?
>> however if i use this, my bean needs to extends HttpServlet.
>>
>> i like a servlet rather than a bean.......
>> am i right?
>>
>> thanks
>>
>>
>> Get your FREE Email at http://mailcity.lycos.com
>> Get your PERSONALIZED START PAGE at http://my.lycos.com
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: tomcat-dev-unsubscribe@jakarta.apache.org
>> For additional commands, e-mail: tomcat-dev-help@jakarta.apache.org
>>
>
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: tomcat-dev-unsubscribe@jakarta.apache.org
>For additional commands, e-mail: tomcat-dev-help@jakarta.apache.org
>
>


Get your FREE Email at http://mailcity.lycos.com
Get your PERSONALIZED START PAGE at http://my.lycos.com

Mime
View raw message