Here is file structure of my JSF application.
User
directory is secured & one needs to authenticate to see user/success.xhtml
. user/success.xhtml
has a button which is used to logout. That button submits form to following method.
public String logout(){
HttpSession session = (HttpSession)FacesContext.getCurrentInstance().getExternalContext().getSession(false);
session.invalidate();
return "index";
}
Last line of above method is there to redirect user to index.xhtml
, as index.xhtml
is not in the same directory as user/success.xhtml
so I am getting following error.
Unable to find matching navigation case with from-view-id '/user/success.xhtml' for action '#{AccContrl.logout()}' with outcome 'index'
How can I redirect to a file present up in the hierarchy?
I tried return "/../index";
but it didn't work.