0
votes

I have a question regarding JSF navigation, if I would just want to do simple page navigation do I need to use redirect method defined in faces-config.xml?

For instance I have page 1 and user clicks rows in datatable value, navigates to page 2 and then do some process and come back to page 1.

I have read in another thread here. As redirect happens it would recreate request scope bean.

Could some one provide some insight into this? So what are the other options available to page to page navigation.

I am using JSF 1.1

Appreciate any help.

Regards

2

2 Answers

2
votes

Depends on what data you wish to pass between pages:

  • if the data is complicated and interconnected ("a wizard scenario") - use faces-config.xml, it will let you pass complex objects between pages;
  • if the data can be presented as simple strings (like "a detail page for a product_id = 145"), just use plain links (like /product.jsf?product_id=145) and inject beans with the request params using faces-config.xml and managed properties (like: #{param.product_id}).

Since you are stuck on using JSF 1.1 (I suspect that even BalusC would be hard pressed to say anything good about it) - you must strive for simplicity everywhere else.

1
votes

as i know request scope is created on each request processing and represents current request and its parameters, so for example when you click on link http://localhost/mypage.jps?a=b&&c=d web servers starts processing this request and creates an request scope that represents data provided in request including those two parameters a which equals b and c which equals d.

as for jsf navigation is a system that provides helpers to define page navigation flow and control it from faces-config.xml. however in your case for simple two page navigation 1 -> 2 -> 1 you can skip this part as it's overkill for only two pages. however if your application will grow in pages and page to page navigation will become more sophisticated then you might consider using faces page navigation