Going to the same page after action in JSF 2

I have a component made in JSF 1.x, this component has the following command:

<h:commandButton ... action="#{templateController.next}" /> 

Where templateController was passed as an EL binding and can be any object that implements a specific interface. The general implementation of next () is simply executing the code, and then returning an empty string causing the same page to refresh:

 public String next() { ..... return ""; } 

Now I'm trying to transfer this component to JSF 2, my problem is that an empty line no longer causes the same page to be updated, instead the structure tries to redirect to a page with the name ".jsf", that is, it simply adds .jsf to which any result. My question is how to return a result that causes the current page to refresh. My component is common, and I don’t know the name of the page on which it will be used.

thanks

+6
java jsf jsf-2 java-ee-5
source share
1 answer

Return null instead or just declare a void method.

+9
source share

All Articles