Quantcast
Channel: OmniFaces & JSF Fans
Viewing all articles
Browse latest Browse all 74

[OmniFaces utilities (2.4)] Get the HTTP request URL with query string, regardless of any forward

$
0
0

[OmniFaces utilities] The getRequestURL() method returns the HTTP request URL with query string, regardless of any forward. This is the full request URL without query string as the enduser sees in browser address bar.

Method:

Usage:

import org.omnifaces.util.Servlets;
...
@WebServlet("/MyServlet")
public class MyServlet extends HttpServlet {
 protected void processRequest(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
  // e.g. http://localhost:8080/MyApp/MyServlet
  String req = Servlets.getRequestURL(request);
 }
 ...
}


Viewing all articles
Browse latest Browse all 74

Trending Articles