在JSF1.2bean中获取浏览器URL

在JSF1.2bean中获取浏览器URL,jsf,Jsf,我在我的网站上使用Tuckey URL rewriter,因此(例如)URL www.test.com/faces/dynamicForm.jsp对用户显示为www.test.com/a/b/c/form.html 在我的bean中,如何访问用户在浏览器中看到的URL,在本例中:www.test.com/a/b/c/form.html您可以从 您可以从中调用方法 HttpServletRequest request = ( HttpServletRequest) FacesContext.get

我在我的网站上使用Tuckey URL rewriter,因此(例如)URL www.test.com/faces/dynamicForm.jsp对用户显示为www.test.com/a/b/c/form.html

在我的bean中,如何访问用户在浏览器中看到的URL,在本例中:www.test.com/a/b/c/form.html

您可以从

您可以从中调用方法

HttpServletRequest request = (
HttpServletRequest) FacesContext.getCurrentInstance().getExternalContext().getRequest();
String url = request.getRequestURL()