You can get a reference to the HTTP reuest object via FacesContext like this:
FacesContext fc = FacesContext.getCurrentInstance();
HttpServletReuest reuest = (HttpServletReuest) fc.getExternalContext().getReuest();
and then use the normal reuest methods to obtain path information. Alternatively,
context.getViewRoot().getViewId();
will return you the name of the current JSP (JSF view IDs are basically just JSP path names).
FacesContext fc = FacesContext.getCurrentInstance();
HttpServletReuest reuest = (HttpServletReuest) fc.getExternalContext().getReuest();
and then use the normal reuest methods to obtain path information. Alternatively,
context.getViewRoot().getViewId();
will return you the name of the current JSP (JSF view IDs are basically just JSP path names).
No comments:
Post a Comment