Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

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

 
alex ni
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 18303
56
Android Eclipse IDE Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic