A friendly place for programming greenhorns!
Big Moose Saloon
Register / Login
Win a copy of
Java SE 8 for the Really Impatient
this week in the
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.
Don't get me started about those stupid
subject: How to specify an object in application scope
jsp:useBean type requirements
jsp:useBean scope question
Question about page scope and implicit object
Is jsp:useBean scope='session' attribute is going to be deprecated?
Storing InputStream object to Application scope in servlet and retrieving
All times are in JavaRanch time: GMT-6 in summer, GMT-7 in winter
| Powered by
Copyright © 1998-2014