Is there something like for JSF?

前端 未结 1 856
时光取名叫无心
时光取名叫无心 2021-01-21 23:33

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?

1条回答
  •  深忆病人
    2021-01-22 00:00

    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 , and for CSS, JS and images respectively:

    
    
    
    

    which renders something like:

    
    
    
    

    0 讨论(0)
提交回复
热议问题