4 Replies Latest reply on Mar 18, 2010 7:16 PM by Haneef Kassam

    problems with {facesContext.externalContext.request.contextPath}

    nimo stephan Master

      I am using actual Seam
      and have problems with the path:


      using this:



      <h:graphicImage value="#{facesContext.externalContext.request.contextPath}/img/myImg.jpg"/>




      does render this link:



      "/myPage/myPage/img/myImg.jpg".




      You see, instead of rendering /myPage/img/myImg.jpg,
      JSF or Seam does render it to /myPage/myPage/img/myImg.jpg and that is not correct!


      Changing the link manually to /myPage/img/myImg.jpg,
      renders the image correctly - as its path is valid.


      When printing out the path, the path is printed correct:


      <h:ouputText value="#{facesContext.externalContext.request.contextPath}"/>



      it prints /myPage, and not /myPage/myPage. So why does graphicImage renders the path twice??


      What is wrong?