Navigate to the Same Page After Action in JSF 2

Posted by shipmaster on Stack Overflow See other posts from Stack Overflow or by shipmaster
Published on 2010-05-06T01:27:21Z Indexed on 2010/05/06 2:28 UTC
Read the original article Hit count: 481

Filed under:
|
|
|

I have a component done in JSF 1.x, this component has a command button as follows

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

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

public String next() {

  .....
 return ""; 
}

Now I am trying to port that component to JSF 2, my problem is that an empty string doesn't cause the same page to refresh anymore, instead, the framework tries to redirect to a page called ".jsf" i.e it just appends .jsf to whatever the outcome is. My question is how to return an outcome that causes the current page to refresh. My component is generic and I don't know before hand the name of the page it is going to be used on.

Thanks

© Stack Overflow or respective owner

Related posts about jsf

Related posts about jsf2