You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Nestor Urquiza <ne...@gmail.com> on 2011/10/03 22:58:03 UTC

Tomcat 7 jasper-el fails to parse boolean EL statement

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

Re: Tomcat 7 jasper-el fails to parse boolean EL statement

Posted by Nestor Urquiza <ne...@gmail.com>.
Thank you very much!
-Nestor



On Oct 4, 2011, at 12:17 AM, Konstantin Kolinko <kn...@gmail.com> wrote:

> 2011/10/4 Nestor Urquiza <ne...@gmail.com>:
>>
>> 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.
>
>> 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.
>
>> I forgot to thanks Mark for the flag.
>>
>> Thank you for taking your time and reading.
>>
>
> Best regards,
> Konstantin Kolinko
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org
>

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Re: Tomcat 7 jasper-el fails to parse boolean EL statement

Posted by Konstantin Kolinko <kn...@gmail.com>.
2011/10/4 Nestor Urquiza <ne...@gmail.com>:
>
> 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.

> 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.

> I forgot to thanks Mark for the flag.
>
> Thank you for taking your time and reading.
>

Best regards,
Konstantin Kolinko

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Re: Tomcat 7 jasper-el fails to parse boolean EL statement

Posted by Nestor Urquiza <ne...@gmail.com>.
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
<kn...@gmail.com> wrote:
>
> 2011/10/4 Nestor Urquiza <ne...@gmail.com>:
> > 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.
>
> > 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}
>
> > 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? :]
>
> >
> >
> >
> > On Oct 3, 2011, at 5:40 PM, Mark Thomas <ma...@apache.org> wrote:
> >
> >> On 03/10/2011 13:58, Nestor Urquiza wrote:
> >>> 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
> >>
> >
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org
>

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Re: Tomcat 7 jasper-el fails to parse boolean EL statement

Posted by Konstantin Kolinko <kn...@gmail.com>.
2011/10/4 Nestor Urquiza <ne...@gmail.com>:
> 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.

> 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}

> 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? :]

>
>
>
> On Oct 3, 2011, at 5:40 PM, Mark Thomas <ma...@apache.org> wrote:
>
>> On 03/10/2011 13:58, Nestor Urquiza wrote:
>>> 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
>>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Re: Tomcat 7 jasper-el fails to parse boolean EL statement

Posted by Nestor Urquiza <ne...@gmail.com>.
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?



On Oct 3, 2011, at 5:40 PM, Mark Thomas <ma...@apache.org> wrote:

> On 03/10/2011 13:58, Nestor Urquiza wrote:
>> 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
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org
>

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Re: Tomcat 7 jasper-el fails to parse boolean EL statement

Posted by Mark Thomas <ma...@apache.org>.
On 03/10/2011 13:58, Nestor Urquiza wrote:
> 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

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org