Get rewritten URL with query string
问题 I'm using tuckey URL rewriting with JSF. I would like to get the relative URL including parameters that the user sees: e.g. example.com/mypage?param=test At the moment if I do #{view.viewId} I get mypage.xhtml what I want to get is: mypage?param=test 回答1: The UIViewRoot#getViewId() returns the JSF view ID. You need to use HttpServletRequest#getRequestURI() to obtain the current request URI and HttpServletRequest#getQueryString() to obtain the current request query string. #{request.requestURI