//Setter and Getter methods
A session-scoped attribute, product, is stored by a servlet. That servlet then forwards to a JSP page. This attribute holds an instance of com.Certkiller.Product class with a name property of “The Matrix” and price property of 39.95.
Given the JSP page code snippet:
<jsp: useBean id = ‘product’ class = ‘com.Certikiller.Product’>
<jsp: setProperty name = ‘product’ property = ‘price’ value = ’49.95’/>
Salim Khatib wrote:
is that not true that useBean standard action first searches the "product" in all the scopes, and if it does not find it
then will create the the instance of product if the scope is not specified
No, if scope is not specified , by default scope is page .
posted 11 years ago
A servlet context listener load a list of com.example.Product objects from a database and stores that list into the catalog attribute of the ServletContext object.
Construct a jsp:useBean standard action to access this catalog.
The given answer is answer <jsp:useBean name = ‘catalog’ id = ‘catalog’ type = ‘com.example.Product’>
But I feel its wrong .. as there is no name attribute for jsp:useBean