Granny's Programming Pearls
"inside of every large program is a small program struggling to get out"
JavaRanch.com/granny.jsp
The moose likes JSF and the fly likes jsf bean instance in servlet Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » JSF
Bookmark "jsf bean instance in servlet" Watch "jsf bean instance in servlet" New topic
Author

jsf bean instance in servlet

Reshma Reddy
Ranch Hand

Joined: Dec 21, 2006
Posts: 197
hi all,

how to get jsf bean instance in servlet.

thanks in advance.
Tim Holloway
Saloon Keeper

Joined: Jun 25, 2001
Posts: 15951
    
  19

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")".


Customer surveys are for companies who didn't pay proper attention to begin with.
Reshma Reddy
Ranch Hand

Joined: Dec 21, 2006
Posts: 197
hi tim

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

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

thanks
 
Consider Paul's rocket mass heater.
 
subject: jsf bean instance in servlet
 
Similar Threads
JSP 2.0 JSTL
Calling two actionListeners in the same commandButton
How to call servlet from JSF ?
Servlet created JSF bean
Spring web flow, JSF and managedbean in servlet