I am looking out for different alternatives of passing parameter from an action method in JSF Managed bean to next view.
For example, I have an action method in my managed bean.
public String actionMethod01(){
String outcome = "nextPage";
return outcome;
}
If I want to pass a parameter to nextPage, one option which I have is:
outcome += "?param1=value1";
But, its not so convinient if I have multiple parameters to be passed.
Is there a better way for doing it?
Best regards, Anand.
There's nothing in the JSF API which makes this easier. Just create a helper/utility method yourself which makes it more convenient so that you can end up with something like this:
return "nextPage" + toQueryString("param1", "value1", "param2", "value2");
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With