开发者

Why i see #{UserBean.userName} in my jsf page while running on Tomcat but it works fine on Glassfish

I am developing an application using Richface开发者_开发技巧s 3.3.3 and Glassfish. It works all right . Now i got the call to port it to Tomcat 6/7 . So when i changed the runtime server on my Netbeans 6.9.1 and run application, I see #{UserBean.userName}, and all similar expressions, in spite of their evaluated values. I tried with all jar combinations, but still could not figure out. Please help.


It looks like your servlet mapping for the faces servlet is not working correctly. Maybe you have to adapt your web.xml. However, as far as I know configuration for faces servlet is the same in Glassfish and Tomcat.

Another reason could be that your tomcat server cannot acces the jsf jar files.

Look here and here


I'll assume that JSF tags works fine, otherwise you didn't see EL plain in the page in webbrowser, so the FacesServlet part is fine. It would otherwise also be weird that it just worked in Glassfish. Missing JSF JARs would only lead to HTTP 500 errors with exceptions complaining that JSF libs are missing in the classpath while the FacesServlet get loaded.

So, EL in JSF doesn't work. This can happen if the JSF EL factory is not found. This can happen if you declared a "custom" JSF EL factory in web.xml, but yet that factory is not present in webapp's classpath. That it works in Glassfish can only mean that you've the following in your web.xml.

<context-param>
    <param-name>com.sun.faces.expressionFactory</param-name>
    <param-value>com.sun.el.ExpressionFactoryImpl</param-value>
</context-param>

Get rid of it. Tomcat doesn't ship with a Glassfish specific EL implementation. Tomcat already ships with its own EL implementation which should work equally good as in Glassfish.

The server startup logs should however already have hinted about this.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜