webtier@glassfish.java.net

Re: [webtier] facesContext not resolved at runtime

From: Jason Lee <jason.d.lee_at_oracle.com>
Date: Fri, 21 May 2010 08:07:26 -0500

On 5/21/10 8:05 AM, webtier_at_javadesktop.org wrote:
> Hi,
>
> I am currently reading the book JSF in Action, and I have a problem with one example.
>
> Here's the code:
>
> <h:commandButton action="success"
> image="#{facesContext.externalContext.requestContextPath}/images/submit.gif"/>
>
> When I execute the .JSP, everything JSF related works fine (taglib, validator, navigation) except the image button that is not displayed.
> When I look to the HTML source code, I can clearly see that the EL part was not resolved:
>
> <input type="image" src="#{request.contextPath}/images/submit.gif" name="j_id_jsp_163829233_2:j_id_jsp_163829233_13" />
>
> I've try to replace facecontext... with request.contextPath, but same result.
> It seems that everything starting with # is just passing through.
>
> Am I missing something?
>
> Environment:
> apache-tomcat-6.0.26
> jakarta-taglibs-standard-1.1.2
> mojarra-1.2_08-FCS
>
That certainly doesn't look right. The docs say that image is a
ValueExpression, so it should be evaluated. Could you update Mojarra to
the latest (1.2_14, or, if you can, 2.0.2) and try again? If it still
fails, it may be an implementation bug.

Thanks.

-- 
Jason Lee
Senior Member of Technical Staff
GlassFish Administration Console
Oracle Corporation
Phone x31197/+1 405-343-1964
Blog http://blogs.steeplesoft.com