In my JSF 2.1 project, I need to get the current URL and I used FacesContext.getViewRoot().getViewId()
but it always returns the previous URL.
I also tried request.getServletPath()
and request.getRequestURI()
but the result was same.
In my JSF 2.1 project, I need to get the current URL and I used FacesContext.getViewRoot().getViewId()
but it always returns the previous URL.
I also tried request.getServletPath()
and request.getRequestURI()
but the result was same.