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?
View the original post :
http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3993032#...
Reply to the post :
http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&a...