How can I get a complete URI address ( http:// .../ ../.)
in JSF using FacesContext ?
Asked
Active
Viewed 378 times
1 Answers
1
Should be something like this:
public String getRequestUrl()
{
Object request = FacesContext.getCurrentInstance().getExternalContext().getRequest();
if (request instanceof HttpServletRequest)
{
String requestedUrl = ((HttpServletRequest) request).getRequestURL().toString();
return requestedUrl;
}
return "";
}
P.s., since you are new to StackOverflow, please vote my answer up and accept if it helped.

Falcon
- 3,150
- 2
- 24
- 35