Win a copy of Kotlin in Action this week in the Kotlin forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

"scope" attribute in jsp:useBean tag  RSS feed

 
Yewint Ko
Ranch Hand
Posts: 90
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi all,
I am getting complex about the "scope" attribute in jsp:useBean tag.
For example,

<jsp:useBean id="item" class="Item" scope="session" />

In the preceding code, will the jsp engine place "item"(instance of Item) in the session scope? or will the jsp engine search it in the session scope? Someone explain to me please...

(sorry if my question is not clear)


 
avi sinha
Ranch Hand
Posts: 453
Google Web Toolkit Hibernate Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yewint Ko wrote:Hi all,
I am getting complex about the "scope" attribute in jsp:useBean tag.
For example,

<jsp:useBean id="item" class="Item" scope="session" />

In the preceding code, will the jsp engine place "item"(instance of Item) in the session scope? or will the jsp engine search it in the session scope? Someone explain to me please...

(sorry if my question is not clear)


your question is clear but the text is not clear

in fact jsp:useBean tag does both the things . at first it will look in to the specified session for it and then if not available there , it will create it and put it in the specified scope.

avi sinha
 
Yewint Ko
Ranch Hand
Posts: 90
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Oh, thanks avi.....
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!