-
1. How to redirect in jsf from application path?
lfryc May 6, 2011 5:52 AM (in response to pankaj_jboss)You should use faces-config.xml for this purpose,
http://java.dzone.com/articles/fluent-navigation-jsf-2
http://www.jsftutorials.net/jsf-navigation-by-examples.html
You have two choices:
1. Your login action will return outcome log/logIn (using implicit navigation feature from JSF 2.0)
2. Your faces-config will define navigation rule for given action method
3. Your login action will return outcome defined by you "loginSuccessful" and you will use it in faces-config.xml to define navigation-rule
-
2. How to redirect in jsf from application path?
pankaj_jboss May 9, 2011 8:15 AM (in response to lfryc)Solution
String projectPath = FacesContext.getCurrentInstance().getExternalContext().getRequestContextPath();
HttpServletResponse response = (HttpServletResponse) FacesContext.getCurrentInstance().getExternalContext().getResponse();
response.sendRedirect(projectPath+"/ServletProject/ValidUser.jsf");