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

<jsp:usebean> how does the container finds instance which we need.  RSS feed

 
sakthi vadivel
Ranch Hand
Posts: 44
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
i have a doubt on <jsp:usebean> process.

first it tries to locate the instance for class attribute, while the server has many instances for many users how container will locate correct instance for our request( or our session) or what ever....

thanks in advance for your time.

 
Hany Shafik
Ranch Hand
Posts: 80
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It tries to find the attribute in the following scopes in this order page, request, session and application.
The existence of an attribute with the same name in other requests doesn't conflict with the current request, the same is true for session and page scopes.
I think the easiest way to implement such feature inside the application server is to have ThreadLocal, since each request is attached to only one thread.
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!