aspose file tools*
The moose likes JSF and the fly likes JSF Bean is empty even though I initialized it in a servlet Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » JSF
Bookmark "JSF Bean is empty even though I initialized it in a servlet" Watch "JSF Bean is empty even though I initialized it in a servlet" New topic
Author

JSF Bean is empty even though I initialized it in a servlet

alex ni
Greenhorn

Joined: Dec 03, 2012
Posts: 2
I have a bean with this header:


I have a loadInventory servlet that initialized the bean and redirects to a JSF


But the JSF shows the bean as empty:



So I'm thinking that "inventoryBean" in my servlet is not the same as the managed Bean also called "inventoryBean."
In that case how do I access the managed bean in the servlet?
alex ni
Greenhorn

Joined: Dec 03, 2012
Posts: 2
Well...I figured it out. The bean was request scoped instead of session scoped. Moderator, should I delete this question? Or leave it up?
Tim Holloway
Saloon Keeper

Joined: Jun 25, 2001
Posts: 16012
    
  19

alex ni wrote:Well...I figured it out. The bean was request scoped instead of session scoped. Moderator, should I delete this question? Or leave it up?


Leave it. People are running into this problem all the time. Request Scope has much less usefulness in JSF than it does in most web frameworks.


Customer surveys are for companies who didn't pay proper attention to begin with.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: JSF Bean is empty even though I initialized it in a servlet