[OmniFaces utilities] The
getRequestQueryString()
method returns the HTTP request query string, regardless of any forward.Method:
Use this one outside JSF context (Servlets#getRequestQueryString()) See also: Utils.coalesce() | Use this one in JSF context (Faces#getRequestQueryString()) See also: Faces.getRequest() | Faces.getContext() |
Some use cases are available right in OmniFaces source code. For example, OmniFaces uses getRequestQueryString() to get the HTTP request URI with query string, regardless of any forward:
public static String getRequestURIWithQueryString(HttpServletRequest request) {
String requestURI = getRequestURI(request);
String queryString = getRequestQueryString(request);
return (queryString == null) ? requestURI : (requestURI + "?" + queryString);
}
Niciun comentariu :
Trimiteți un comentariu