How to pass parameters between scope beans

This is a question that once bothered me. My application uses ICEFaces for our UI framework and Spring 2.5 for dependency injection. Also, Spring actually supports all of our beans support, not the ICEFaces framework, so our config-faces are mostly empty.

Navigation is not even done with navigation rules. We are doing manual redirects to new windows using window.open.

All our beans are defined in our appContext file as request scope. I have an ABC page that is backed by BackingBeanABC. Inside this support bean, I have a say parameter:

private Order order;

      

Then I have an XYZ page maintained by BackingBeanXYZ. When I redirect from ABC page to XYZ page, I want to pass the "order" property from ABC to XYZ. The problem is that everything has a request scope and I do a redirect, I lose the value "description".

During redirection, there should be an easier way to pass objects between beans in the request scope. Can anyone help with this issue?

+2


a source to share


2 answers


Session scope solves your problem.

Read more about this in the Spring reference documentation .



Another alternative is to set the order object directly to the HttpSession object . I would prefer this and only your services, controllers and stores are managed by Spring.

+1


a source


Create a single session scope bean that can hold a reference to the request beans via FacesContext.



+1


a source







All Articles