What is the best way to send parameters between pages?

We use JSF in our project (they really liked it), on each page there was a reverse Java bean file.

To move (redirect) from one page to another, I need to put all the parameters (search criteria) in the request area before redirecting, and then return them back to the next page constructor. When you have few pages and want to return to the top, it becomes very unpleasant to maintain.

For example, if I have page 1 with advanced search filters that redirects to page 2, depending on the selected item and from page 2, you get another list to find out more. Now every time I need to put all the parameters in the request area / read them again, save them in hidden fields and return them.

What exactly is wrong with this method and what is better to do in JSF?

EDIT : Environment is an IBM Rational Application Developer (RAD) that has its own JSF implementation. Not sure if that matters.

+3
source share
3 answers

() , /. , ( " " " ", , ). , . , .

beans ( beans, ) h:inputHidden , , . , . , Tomahawk <t:saveState>, , "" bean. JSF .

* , 1 , 2, 2, , . / , .

JSF? *

. , , . , .

:

EDIT: - IBM Rational Application Developer (RAD), JSF. , .

. IBM JSF. ( hx , "Faces Client Framework" ). WSAD/RAD Sun JSF RI (Mojarra) JSF, . , .

+5

JSF, , , beans , , bean ? , ..

, , , bean, , , ( , ).

, JSF , , , , , bean ?

+1

bean.
MyFaces, PageFlowScope. Seam, .
pageflowscope , beans. , PhaseListener . , - page1 → page2 → page3, bean PhaseListener, 1.
, .

+1

Source: https://habr.com/ru/post/1735001/


All Articles