This content has been marked as final.
Show 1 reply
-
1. Re: ServletRequest in Seam
pmuir Dec 12, 2006 6:41 AM (in response to sherkan777)I use this in a phase listener:
protected String getExternalApplicationRoot(FacesContext ctx) { if (ctx.getExternalContext().getRequest() instanceof HttpServletRequest) { HttpServletRequest request = (HttpServletRequest) ctx.getExternalContext().getRequest(); return "http://" + request.getServerName() + ":" + request.getServerPort() + ctx.getExternalContext().getRequestContextPath() + "/"; } else { return null; } }
If the user was viewing http://foo.bar.com:1234/myApp/management/editUser.jsf the String returned from the function would be http://foo.bar.com:1234/myApp. Does that help?