2

I'm trying to run my project (normally working on tomcat7) on tomcat6. But JSF can't call methods with parameters now, e.g.

<h:commandLink action="#{bean.setpage('index')}"/>

It works normally on Tomcat7..

Is it possible to call method with parameter on tomcat6?

UPDATE: both answers bellow are correct, and i also had to update context.xml:

<context-param>
    <param-name>org.apache.myfaces.EXPRESSION_FACTORY</param-name>
    <param-value>com.sun.el.ExpressionFactoryImpl</param-value>
</context-param>
<context-param>
    <param-name>com.sun.faces.expressionFactory</param-name>
    <param-value>com.sun.el.ExpressionFactoryImpl</param-value>
</context-param>

2 Answers 2

2

If you are using a container which supports JSF 2.0 completely, you can directly do

<h:commandLink action="#{bean.setpage('index')}"/>.

Else you have to use f:param or f:attribute. I think Tomcat 7 supports jsf 2 completely but Tomcat 6 does not support out of the box. So you have to add jstl-api-1.2.jar, jstl-impl-1.2.jar and el-impl-2.2.jar libraries to make it work on Tomcat 6.

Sign up to request clarification or add additional context in comments.

6 Comments

@gaffcz If you add the JSTL 1.2 libary and el-impl-2.2.jar to the WEB-INF/lib and it should work on Tomcat 6 as well.
Thank you. And add those libs to lib of project or to tomcat6/lib directory?
@gaffcz el libraries to tomcat6/lib and jstl1.2 libraries to project lib.
Still doesn't work :( SEVERE: Servlet.service() for servlet Faces Servlet threw exception org.apache.el.parser.ParseException: Encountered " "(" "( "" at line 1, column 22. Was expecting one of: "}" ...
@gaffcz By the way did you remove the existing el jar file that is already there in Tomcat 6 dist. Anyways, if you have a lot of time you can try and get it working on Tomcat 6, but otherwise I would suggest using one of the methods given here for passing parameters from page to bean mkyong.com/jsf2/…
|
1

yes it is, just check that u have the right the el and el-impl jars in the lib folder of tomcat. (2.2 i think)

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.