[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:
See also: Faces.getRequestDomainURL() | Faces.getRequestURI()
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);
}
...
}
Niciun comentariu :
Trimiteți un comentariu