File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
A friendly place for programming greenhorns!
Big Moose Saloon
Register / Login
Win a copy of
Android Security Essentials Live Lessons
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 scope question
jsp:useBean type requirements
Storing InputStream object to Application scope in servlet and retrieving
Is jsp:useBean scope='session' attribute is going to be deprecated?
Question about page scope and implicit object
All times are in JavaRanch time: GMT-6 in summer, GMT-7 in winter
| Powered by
Copyright © 1998-2014