• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Question ID :999996968700 JWeb+

 
Ranch Hand
Posts: 35
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
You have declared a useBean tag as:
<jsp:useBean id="man" class="animal.Human" scope="application"/>
In which type of object will this bean be kept?
Answers :
Servlet
HttpSession
ServletContext
ServletConfig
ApplicationContext
Can anybody help me with the answer?
Thanks
-Manoj.
 
Ranch Hand
Posts: 133
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,
I would say: ServletContext.
The scope "application" corresponds to ServletContext which keeps the information for the application
But I've been worng before!
/Enrico
 
Manoj Pooleery
Ranch Hand
Posts: 35
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks. I missed the 'scope' part of the declaration.
-Manoj.
 
Ranch Hand
Posts: 83
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by Enrico Mannarino:
I would say: ServletContext.
The scope "application" corresponds to ServletContext which keeps the information for the application
But I've been worng before!
/Enrico


I try not to respond to answers that are correct, (and your answer is correct). I would just like to point out that many questions of this type can be answered by checking the specification. Here is the relevant text from JSP 2.0:
JSP.5.1 <jsp:useBean>
A jsp:useBean action associates an instance of a Java programming language object defined within a given scope and available with a given id with a newly declared scripting variable of the same id.
.....
The scope Attribute
The scope=�page|request|session|application� attribute/value tuple is associated with, and modifies the behavior of the id attribute described above (it has both translation time and client request processing time semantics). In particular it describes the namespace, the implicit lifecycle of the object reference associated with the name, and the APIs used to access this association, as follows:
.....
application - The named object is available from the current page�s ServletContext object using the getAttribute(name) method.
 
reply
    Bookmark Topic Watch Topic
  • New Topic