tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Derek DeMoro" <ddem...@home.com>
Subject Re: use servlet context in a bean
Date Sat, 27 May 2000 17:03:09 GMT
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
>


Mime
View raw message