Is there a taglib in JSF for inserting the proper application context root in any URL I want, just like the
tag in JSP does?
Not exactly that, but all JSF components which refer to an URL resource will already automatically include the proper context path and eventually also the FacesServlet
mapping. For example the
which renders something like (assuming that your context path is /contextname
and your FacesServlet
is mapped on *.xhtml
):
Link to other page
You can include request parameters by
which renders something like:
Link to other page
Other link components which also do that are the
which renders something like: