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

jsp:usebean -- need info  RSS feed

 
Em Aiy
Ranch Hand
Posts: 226
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
i have made instantiated a bean on main page with the following code



Now, the bean is initialized for application scope. What i want to do is to access this same bean on some other page, how can i? what should i tell in the jsp:useBean tag that it will not instantiate a new bean and will use the already instantiated bean?
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 66203
151
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Read the description of useBean again. If the bean already exists in the specified scope, it is not instantiated.
 
Em Aiy
Ranch Hand
Posts: 226
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
so you mean, using this same syntax the bean will not be instantiated again (if it is in the scope)
 
Ben Souther
Sheriff
Posts: 13411
Firefox Browser Redhat VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yes.
For more information, see JSP.5.1 in the JSP spec.
There is a link in my signature.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!