views:

27

answers:

1

Hi!

I moved from JSF 1.2 to JSF 2.0 and it seems I missed something during the switch. I have following scenario:

  1. There is a button on one page with actionListener set to one managed bean's method which adds an object to request by calling FacesContext.getCurrentInstance().getExternalContext().getRequestMap().put("foo", fooObject);
  2. Navigation is properly handled to other page where other managed bean is initialized.
  3. The constructor of other managed bean tries to retrieve passed object from request by calling FacesContext.getCurrentInstance().getExternalContext().getRequestMap().get("foo"); and to initialize itself with received values.

Both managed beans are request scoped. I notice that constructor can't retrieve proper value from request because request map doesn't contain "foo" key.

What am I doing wrong? Is there a better way to do this?

Thanks in advance.

related questions