public FacesContext getFacesContext() {
return FacesContext.getCurrentInstance();
}
public ExternalContext getExternalContext() {
return getFacesContext().getExternalContext();
}
public void getRequestAPartURL() {
HttpServletRequest request =
(HttpServletRequest)getExternalContext().getRequest();
// Get the current URL
String requestUrl = request.getRequestURL().toString();
// Get the context root
String contextRoot = getExternalContext().getRequestContextPath();
// Get host and port number
requestUrl = requestUrl.substring(0, requestUrl.indexOf(contextRoot))
}
return FacesContext.getCurrentInstance();
}
public ExternalContext getExternalContext() {
return getFacesContext().getExternalContext();
}
public void getRequestAPartURL() {
HttpServletRequest request =
(HttpServletRequest)getExternalContext().getRequest();
// Get the current URL
String requestUrl = request.getRequestURL().toString();
// Get the context root
String contextRoot = getExternalContext().getRequestContextPath();
// Get host and port number
requestUrl = requestUrl.substring(0, requestUrl.indexOf(contextRoot))
}
No comments:
Post a Comment