You simply have to import the class in your servlet code, instantiate a copy
of the class, assign it's values and store it as an attribute by using the
ServletContext (Probably best done in the init of your Controller Servlet
since it runs once)
ie:
super.init(config);
ctx = config.getServletContext();
ctx.setAttribute("Attribute.Name", Object ):
/Dean
-----Original Message-----
From: A mailing list about Java Server Pages specification and reference
[mailto:[EMAIL PROTECTED]]On Behalf Of Raja Nagendra Kumar
Sent: Friday, August 25, 2000 3:08 AM
To: [EMAIL PROTECTED]
Subject: equivalent <jsp:useBean id="bt" scope="application" class=
"TestBean"/> in servlets
Placed At : BLR
Nagendra R@SATYAM
08/25/2000 12:38 PM
Hi!
Can any one please tell me the equivalent of
<jsp:useBean id="bt" scope="application" class="TestBean"/>
in servlets.
I wish to store application scope objects in servlets, so that the stored
objects are available to all the clients from any page (either other servlet
or
jsp pages).
Regards,
Nagendra
===========================================================================
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff
JSP-INTEREST".
Some relevant FAQs on JSP/Servlets can be found at:
http://java.sun.com/products/jsp/faq.html
http://www.esperanto.org.nz/jsp/jspfaq.html
http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets
===========================================================================
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
Some relevant FAQs on JSP/Servlets can be found at:
http://java.sun.com/products/jsp/faq.html
http://www.esperanto.org.nz/jsp/jspfaq.html
http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets