The difference in the evaluation of the context of the EL context between outputLink and graphicImage

I use the following to get the reference document in our application. My problem is that while <h:graphicImage>evaluating the context path correctly, it h:outputLinkrejects it to zero. I tried to use $and #in h:outputLink, because I understand that they have different evaluation times.

What is the difference in how two EL expressions are evaluated?

<h:outputLink value="${pageContext.servletContext.contextPath}/services/help.pdf">
    <h:graphicImage 
        url="${pageContext.servletContext.contextPath}/images/help.png" 
        alt="Online Help"/>
</h:outputLink>
+5
source share
2 answers

, <h:outputLink>, , Facelets JSP. ${pageContext} Facelets. JSP. . .

, <h:graphicImage>, . . , , .

<h:graphicImage url="/images/help.png" alt="Online Help"/>

<h:outputLink> . <h:link> . . Facelets #{request}, HttpServletRequest, , , getContextPath() ( <h:graphicImage> ).

<h:outputLink value="#{request.contextPath}/services/help.pdf">
+15

# ​​{facesContext.externalContext.requestContextPath}, ,

,

+3

All Articles