• Post Reply Bookmark Topic Watch Topic
  • New Topic

jsp:useBean scope="application" help me wat is scope?

 
Manish Malhotra
Greenhorn
Posts: 29
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
1. If Im using this useBean action tag:-
<jsp:useBean id="obj" class="classname" scope="application"/>
then If I close my browser & server is still running then obj object of class would be available for the new screens of the same application or not.
2. If Im using this useBean action tag:-
<jsp:useBean id="obj" class="classname" scope="request"/>
then If I close my browser then "obj" object of class "className" would be not available for the new screens of the same application or not.
Means for the new browser we would have new request or same.
 
William Brogden
Author and all-around good cowpoke
Rancher
Posts: 13078
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Scope = "request" means the bean is only valid during the request that created it. Another request will get a new bean.
Scope = "application" means the bean will be seen by all JSP or servlets in the web application until the server is stopped or unloads the application for some reason.
Bill
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!