Note that there are some explanatory texts on larger screens.

plurals
  1. POUsing EL 2.2 with Tomcat 6.0.24
    primarykey
    data
    text
    <p>With JSF 2 you should be able to do this:</p> <pre><code>&lt;h:commandButton action="#{myBean.myAction(myParameter)}"/&gt; </code></pre> <p>which would then call the action method, passing in the parameter (assume it's an Integer):</p> <pre><code>@ManagedBean @SessionScoped public class MyBean { ... public String myAction(Integer myParameter) { // do something return null; } ... } </code></pre> <p>This works on Glassfish v3 perfectly. However not on Tomcat, you get an ELException notifying of the parse error</p> <pre><code>Caused by: javax.el.ELException: Error Parsing: ... </code></pre> <p>Now, there's a <a href="http://wiki.apache.org/myfaces/HowToEnableEl22" rel="noreferrer">documented way of making this work using EL 2.2</a> and Glassfish's implementation by replacing the <code>el-api</code> jar in the Tomcat lib directory, however I still get the same error occurring with no luck. Tomcat's really starting to frustrate me! JSF2 is meant to be easier!</p> <p>Maven POM fragments:</p> <pre><code>&lt;repositories&gt; &lt;repository&gt; &lt;id&gt;sun&lt;/id&gt; &lt;url&gt;http://download.java.net/maven/2/&lt;/url&gt; &lt;/repository&gt; &lt;repository&gt; &lt;id&gt;jboss&lt;/id&gt; &lt;url&gt;http://repository.jboss.com/maven2/&lt;/url&gt; &lt;/repository&gt; &lt;/repositories&gt; ... &lt;dependency&gt; &lt;groupId&gt;javax.el&lt;/groupId&gt; &lt;artifactId&gt;el-api&lt;/artifactId&gt; &lt;version&gt;2.2&lt;/version&gt; &lt;scope&gt;provided&lt;/scope&gt; &lt;/dependency&gt; &lt;dependency&gt; &lt;groupId&gt;org.glassfish.web&lt;/groupId&gt; &lt;artifactId&gt;el-impl&lt;/artifactId&gt; &lt;version&gt;2.2&lt;/version&gt; &lt;scope&gt;provided&lt;/scope&gt; &lt;/dependency&gt; </code></pre> <hr> <p>More info.</p> <p>Here's part of the stack trace, seems it's still using an Apache EL implementation, and not the one I dumped into lib. I completely removed the existing <code>el-api.jar</code> that came with Tomcat, is there an <code>el-impl.jar</code> I'm meant to remove somewhere too that may be overriding something?</p> <pre><code>Was expecting one of: "}" ... "." ... "[" ... "&gt;" ... "gt" ... "&lt;" ... "lt" ... "&gt;=" ... "ge" ... "&lt;=" ... "le" ... "==" ... "eq" ... "!=" ... "ne" ... "&amp;&amp;" ... "and" ... "||" ... "or" ... "*" ... "+" ... "-" ... "/" ... "div" ... "%" ... "mod" ... at org.apache.el.parser.ELParser.generateParseException(ELParser.java:2142) at org.apache.el.parser.ELParser.jj_consume_token(ELParser.java:2024) at org.apache.el.parser.ELParser.DeferredExpression(ELParser.java:113) at org.apache.el.parser.ELParser.CompositeExpression(ELParser.java:40) at org.apache.el.lang.ExpressionBuilder.createNodeInternal(ExpressionBuilder.java:93) ... 64 more </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload