A friendly place for programming greenhorns!
Big Moose Saloon
Register / Login
How to specify an object in application scope
Joined: May 17, 2001
Jun 10, 2004 04:38:00
How can I specify an object in application scope, for example I have specified in
as follows, similarly I have an object I want to specify it in
<jsp:useBean class="mypack.MyClass" id="MyClassObj" scope="application"/>
Thanks in advance.
Joined: Jul 18, 2001
Jun 10, 2004 06:57:00
All that application scope means in a JSP is that the object is going to be set in the
. Therefore, to do the same thing in a
you would do:
getServletContext().setAttribute("someAttributeName", new Integer(1));
Word of warning, due to the nature of Servlets and Web Applications, the
is not thread-safe. Be very careful in how you use it.
rocket mass heater
subject: How to specify an object in application scope
Question about page scope and implicit object
jsp:useBean type requirements
Is jsp:useBean scope='session' attribute is going to be deprecated?
Storing InputStream object to Application scope in servlet and retrieving
jsp:useBean scope question
All times are in JavaRanch time: GMT-6 in summer, GMT-7 in winter
| Powered by
Copyright © 1998-2013