Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6668635
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T03:03:45+00:00 2026-05-26T03:03:45+00:00

Is there a taglib in JSF for inserting the proper application context root in

  • 0

Is there a taglib in JSF for inserting the proper application context root in any URL I want, just like the <c:url> tag in JSP does?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-26T03:03:45+00:00Added an answer on May 26, 2026 at 3:03 am

    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 <h:link>:

    <h:link value="Link to other page" outcome="otherpage" />
    

    which renders something like (assuming that your context path is /contextname and your FacesServlet is mapped on *.xhtml):

    <a href="/contextname/otherpage.xhtml">Link to other page</a>
    

    You can include request parameters by <f:param>:

    <h:link value="Link to other page" outcome="otherpage">
        <f:param name="foo" value="#{bean.foo}" />
    </h:link>
    

    which renders something like:

    <a href="/contextname/otherpage.xhtml?foo=bar">Link to other page</a>
    

    Other link components which also do that are the <h:outputStylesheet>, <h:outputScript> and <h:graphicImage> for CSS, JS and images respectively:

    <h:outputStylesheet library="default" name="css/foo.css" />
    <h:outputScript library="default" name="js/foo.js" />
    <h:graphicImage library="default" name="images/foo.png" />
    

    which renders something like:

    <link rel="stylesheet" type="text/css" href="/contextname/javax.faces.resource/css/foo.css.xhtml?ln=default" />
    <script type="text/javascript" src="/contextname/javax.faces.resource/js/foo.js.xhtml?ln=default"></script>
    <img src="/contextname/javax.faces.resource/images/foo.png.xhtml?ln=default" />
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Is there an equivalent of the <c:url/> tag (of jsp core taglib fame) for
I am using JSF 2.0 on JSP 2.1. Is there any possibility to use
I'm a JSP newbie, I understand that there are some kind of taglib files
when i'm using custom tag in JSP using taglib the attribute type must be
There are a few ways to get class-like behavior in javascript, the most common
Is there a way to call a taglib closure from inside the grails console?
I want to use simplified select one tag, which would generate select items list
I have jsf application in which I have to use a facelet custom component
Im moving first steps into JSF framework. I so make these jsp/bean : index.jsp
I am writing some JSP 2.x tag files. I have searched for a few

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.