• Post Reply Bookmark Topic Watch Topic
  • New Topic

jsf bean instance in servlet  RSS feed

 
Reshma Reddy
Ranch Hand
Posts: 197
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi all,

how to get jsf bean instance in servlet.

thanks in advance.
 
Tim Holloway
Bartender
Posts: 18662
71
Android Eclipse IDE Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It depends on the bean's scope. JSF beans are just ordinary session, request and application scope objects, you you'd gain access to them exactly the same as you would for non-JSF beans. For example, "session.getAttribute("myjsfbean")".
 
Reshma Reddy
Ranch Hand
Posts: 197
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi tim

my jsf bean scop is session level and I tried this but not working

Bean searchBean = (Bean) request.getSession().getAttribute("bean");

thanks
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!