Discussion:
Tomcat 7 jasper-el fails to parse boolean EL statement
Nestor Urquiza
2011-10-03 20:58:03 UTC
Permalink
Hello,

I was having this issue
http://stackoverflow.com/questions/3879794/spring-3-petclinic-owner-new-invalid-expression-in-tomcat-7/7640435#7640435

So I decided to try a couple of quick fixes and I solved it replacing the
jasper-el.jar. I have blogged about the issue in
http://thinkinginsoftware.blogspot.com/2011/10/tomcat-7-jstl-failed-to-parse.html

Not sure if this is the list to post this issue. Hopefully it will help
others.

Best,
-Nestor
Mark Thomas
2011-10-03 21:40:11 UTC
Permalink
Post by Nestor Urquiza
Hello,
I was having this issue
http://stackoverflow.com/questions/3879794/spring-3-petclinic-owner-new-invalid-expression-in-tomcat-7/7640435#7640435
So I decided to try a couple of quick fixes and I solved it replacing the
jasper-el.jar. I have blogged about the issue in
http://thinkinginsoftware.blogspot.com/2011/10/tomcat-7-jstl-failed-to-parse.html
Not sure if this is the list to post this issue. Hopefully it will help
others.
This is an application bug, not a Tomcat bug. Tomcat 7 just enforces the
requirements of the EL spec more strictly than Tomcat 6 did.

You can disable this additional check using:
-Dorg.apache.el.parser.SKIP_IDENTIFIER_CHECK=false

although the right solution is to fix the broken application.

Mark
Nestor Urquiza
2011-10-03 22:39:07 UTC
Permalink
Hi Mark,

So you are suggesting Spring pet clinic application is broken? What
would be the correct syntax then for the expresion that is failing?
Why tge latest version of jasper-el does not exhibit the problem when
deployed in tomcat 7?
Post by Mark Thomas
Post by Nestor Urquiza
Hello,
I was having this issue
http://stackoverflow.com/questions/3879794/spring-3-petclinic-owner-new-invalid-expression-in-tomcat-7/7640435#7640435
So I decided to try a couple of quick fixes and I solved it replacing the
jasper-el.jar. I have blogged about the issue in
http://thinkinginsoftware.blogspot.com/2011/10/tomcat-7-jstl-failed-to-parse.html
Not sure if this is the list to post this issue. Hopefully it will help
others.
This is an application bug, not a Tomcat bug. Tomcat 7 just enforces the
requirements of the EL spec more strictly than Tomcat 6 did.
-Dorg.apache.el.parser.SKIP_IDENTIFIER_CHECK=false
although the right solution is to fix the broken application.
Mark
---------------------------------------------------------------------
Konstantin Kolinko
2011-10-03 23:35:03 UTC
Permalink
Post by Nestor Urquiza
Hi Mark,
So you are suggesting Spring pet clinic application is broken?
There are many implementations of Pet Clinic out there. Yes, that one is broken.
Post by Nestor Urquiza
What
would be the correct syntax then for the expresion that is failing?
You are not reading your answers, nor you are searching the archives.

This feature was discussed at least 3 times this summer.

${owner['new']} is direct equivalent of ${owner.new}
Post by Nestor Urquiza
Why tge latest version of jasper-el does not exhibit the problem when
deployed in tomcat 7?
Is there "latest" version of it that is not already in tomcat 7? :]
Post by Nestor Urquiza
Post by Mark Thomas
Post by Nestor Urquiza
Hello,
I was having this issue
http://stackoverflow.com/questions/3879794/spring-3-petclinic-owner-new-invalid-expression-in-tomcat-7/7640435#7640435
So I decided to try a couple of quick fixes and I solved it replacing the
jasper-el.jar. I have blogged about the issue in
http://thinkinginsoftware.blogspot.com/2011/10/tomcat-7-jstl-failed-to-parse.html
Not sure if this is the list to post this issue. Hopefully it will help
others.
This is an application bug, not a Tomcat bug. Tomcat 7 just enforces the
requirements of the EL spec more strictly than Tomcat 6 did.
-Dorg.apache.el.parser.SKIP_IDENTIFIER_CHECK=false
although the right solution is to fix the broken application.
Mark
Nestor Urquiza
2011-10-04 02:33:37 UTC
Permalink
Hi Konstantin,

Please bare with me. I did not get the answer to my question in Stack
overflow by email as I was expecting. In fact my original question was
deleted by a moderator and when I asked why, providing the info I am
providing below, my question was cut.

I understand I can change my code in hundreds of JSP with a simple
search and replace to favor
${owner['new']} because ${owner.new} is not valid because new is not
a correct Java identifier. Thanks!

I am just trying to clarify the rest of my findings (which were
deleted from stack overflow but posted in my blog) Here we go:

Downloading latest jasper-el
http://repo1.maven.org/maven2/org/apache/tomcat/jasper-el/6.0.33/jasper-el-6.0.33.jar
(from August 2011 which I consider latest - please correct me if I am
wrong) or even copying the jar from a previous tomcat installation
allows ${owner.new} to work. The version of jasper-el shipped with
tomcat 7.0.22 does not. Is that a bug in jasper-el-6.0.33.jar?


Furthermore, the alternative ${owner.isNew()} which does work in
Tomcat 7.0.22 default jasper-el fails when I use jasper-el-6.0.33.jar.
Is that then another bug in jasper-el-6.0.33.jar?


I forgot to thanks Mark for the flag.

Thank you for taking your time and reading.

Best,
-Nestor


trick. Just remember to remove the old jar file:
?
1
2
3
4
$ cd ~
$ curl http://repo1.maven.org/maven2/org/apache/tomcat/jasper-el/6.0.33/jasper-el-6.0.33.jar
jasper-el-6.0.33.jar
$ mv /opt/apache-tomcat-7.0.22/lib/jasper-el.jar .
$ cp jasper-el-6.0.33.jar /opt/apache-tomcat-7.0.22/lib/


On Mon, Oct 3, 2011 at 7:35 PM, Konstantin Kolinko
Post by Nestor Urquiza
Hi Mark,
So you are suggesting Spring pet clinic application is broken?
There are many implementations of Pet Clinic out there. Yes, that one is broken.
Post by Nestor Urquiza
What
would be the correct syntax then for the expresion that is failing?
You are not reading your answers, nor you are searching the archives.
This feature was discussed at least 3 times this summer.
${owner['new']} is direct equivalent of ${owner.new}
Post by Nestor Urquiza
Why tge latest version of jasper-el does not exhibit the problem when
deployed in tomcat 7?
Is there "latest" version of it that is not already in tomcat 7? :]
Post by Nestor Urquiza
Post by Mark Thomas
Post by Nestor Urquiza
Hello,
I was having this issue
http://stackoverflow.com/questions/3879794/spring-3-petclinic-owner-new-invalid-expression-in-tomcat-7/7640435#7640435
So I decided to try a couple of quick fixes and I solved it replacing the
jasper-el.jar. I have blogged about the issue in
http://thinkinginsoftware.blogspot.com/2011/10/tomcat-7-jstl-failed-to-parse.html
Not sure if this is the list to post this issue. Hopefully it will help
others.
This is an application bug, not a Tomcat bug. Tomcat 7 just enforces the
requirements of the EL spec more strictly than Tomcat 6 did.
-Dorg.apache.el.parser.SKIP_IDENTIFIER_CHECK=false
although the right solution is to fix the broken application.
Mark
---------------------------------------------------------------------
Konstantin Kolinko
2011-10-04 04:17:01 UTC
Permalink
Post by Nestor Urquiza
Downloading latest jasper-el
http://repo1.maven.org/maven2/org/apache/tomcat/jasper-el/6.0.33/jasper-el-6.0.33.jar
(from August 2011 which I consider latest - please correct me if I am
wrong) or even copying the jar from a previous tomcat installation
allows ${owner.new} to work. The version of jasper-el shipped with
tomcat 7.0.22 does not. Is that a bug in jasper-el-6.0.33.jar?
You should download ASF software from download pages on *.apache.org sites. :)

That jar is just some random piece of Tomcat 6.0.33. You cannot
download it and drop into any other Tomcat version.

It is useful if you need to compile your own code that uses those
internal APIs of Tomcat, but you should not use it at runtime at a
proper Tomcat instance.

If you look into META-INF/MANIFEST.MF file inside the jar you should see that
Specification-Title: Apache Tomcat
Specification-Version: 6.0
etc.
Post by Nestor Urquiza
Furthermore, the alternative ${owner.isNew()} which does work in
Tomcat 7.0.22 default jasper-el fails when I use jasper-el-6.0.33.jar.
${owner['new']} is accessing property "new" of object "owner".

That is exactly the same that you tried with ${owner.new}.

The ${owner.isNew()} expression is a different beast - it is a method call,

and method calls support is introduced in JSP 2.2/Expression Language
2.2. You will have to use Tomcat 7.0.
Post by Nestor Urquiza
I forgot to thanks Mark for the flag.
Thank you for taking your time and reading.
Best regards,
Konstantin Kolinko
Nestor Urquiza
2011-10-04 10:02:58 UTC
Permalink
Thank you very much!
-Nestor
Post by Konstantin Kolinko
Post by Nestor Urquiza
Downloading latest jasper-el
http://repo1.maven.org/maven2/org/apache/tomcat/jasper-el/6.0.33/jasper-el-6.0.33.jar
(from August 2011 which I consider latest - please correct me if I am
wrong) or even copying the jar from a previous tomcat installation
allows ${owner.new} to work. The version of jasper-el shipped with
tomcat 7.0.22 does not. Is that a bug in jasper-el-6.0.33.jar?
You should download ASF software from download pages on *.apache.org sites. :)
That jar is just some random piece of Tomcat 6.0.33. You cannot
download it and drop into any other Tomcat version.
It is useful if you need to compile your own code that uses those
internal APIs of Tomcat, but you should not use it at runtime at a
proper Tomcat instance.
If you look into META-INF/MANIFEST.MF file inside the jar you should see that
Specification-Title: Apache Tomcat
Specification-Version: 6.0
etc.
Post by Nestor Urquiza
Furthermore, the alternative ${owner.isNew()} which does work in
Tomcat 7.0.22 default jasper-el fails when I use jasper-el-6.0.33.jar.
${owner['new']} is accessing property "new" of object "owner".
That is exactly the same that you tried with ${owner.new}.
The ${owner.isNew()} expression is a different beast - it is a method call,
and method calls support is introduced in JSP 2.2/Expression Language
2.2. You will have to use Tomcat 7.0.
Post by Nestor Urquiza
I forgot to thanks Mark for the flag.
Thank you for taking your time and reading.
Best regards,
Konstantin Kolinko
---------------------------------------------------------------------
Loading...