JSF 2: Which area should I use?

I was confused about the area that I should use.

Here I have a module consisting of 4 page levels, such as viewing a page - page title - page detail of this page detail of the title page of this part. I think that each page will have its own managed page.

The deepest level, level 4 (additional detail page), will be able to access all other states of managed objects at the external level. Level 3 (the details page) can access the managed state of the managed site 2 (header page) and the state of managed management (1) of level 1.

External controlled ointment will not be able to access the deeper state of the managed organization

The use of the request area will not be performed, since deep-level pages must have access to another state at external levels.

The use of the session area will be performed, but memory will be consumed when the user switches to other unrelated program modules, and those that are not used by beans will remain in memory until the session. And what's more, I cannot open these page chains in different tabs.

Using the talk area is confusing because I don’t have clear begin () and end () like wizard style pages or quiz pages. The user can switch back with these pages and perform actions on any page.

Using a viewport seems possible, but I have to use a parameter passed from one page to another. A deeper level of beans will not be able to access external beans, but they may receive string parameters from the previous page. This seems to be ugly, because I may need to again request a lot of information from the database that could be executed in the previous managed bean.

I think wrong?

Share your thoughts.

Thanks
Albert Cam

+3
source share
1 answer

Flash JSF 2 . , . , , . 1, . 2 -, PostConstruct . 2, , . 3, . , . beans . :

Level1Bean

@public String toLevel2Button(){
    ELFlash.getFlash().put("data1", object1);
    ELFlash.getFlash().put("data2", object2);
    return "level2";

Level2Bean

@PostConstruct
public void init(){
    object1 = (MyType1)ELFlash.getFlash().get("data1");
    object2 = (MyType2)ELFlash.getFlash().get("data2");
}

public String toLevel3(){
    ELFlash.getFlash().put("data1", object1);
    ELFlash.getFlash().put("data2", object2);
    ELFlash.getFlash().put("data3", object3);
    return "level3";
}

. - . , .

+3

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


All Articles