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.
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.
On top of spaghetti all covered in cheese, there was this tiny ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop