You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Marco Guazzone <ma...@gmail.com> on 2009/06/07 10:28:09 UTC

Update to 6.0.20: deferred EL expressions

Dear Tomcat users,

I'm updating Tomcat from 6.0.18 to 6.0.20.
My web-app use JSP 2.1 and JSF 1.2 (v. 1.2_12).
The first difference I've noticed is that the following code snip
(part of a JSPX page for outputting an HTML page) get unparsed in
Tomcat 6.0.20:

--- [snip] ---
...
<link rel="stylesheet"
href="#{facesContext.externalContext.requestContextPath}/resources/theme/current/css/screen.css"
type="text/css" />
<link rel="shortcut icon"
href="#{facesContext.externalContext.requestContextPath}/resources/theme/current/img/favicon.ico"
type="image/x-icon"/>
...
--- [/snip] ---

With Tomcat 6.0.18 the expression #{} is successfully evaluated while
with Tomcat 6.0.20 that is printed as-is.

I've looked on the JSP 2.1 specs and from Section 1.2.4:
"...              in JSP 2.1, #{} expressions are only allowed for tag
attributes that accept deferred expressions. #{expr} will generate an
error if used anywhere else."
The behavior of Tomcat 6.0.20 seems to be the right one (while 6.0.18
was wrong).

So, before changing all my JSP pages I ask you for a confirmation.

Thank you very much for any feedback!!!!

Cheers,

-- Marco

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


Re: Update to 6.0.20: deferred EL expressions

Posted by Marco Guazzone <ma...@gmail.com>.
On Mon, Jun 8, 2009 at 9:30 AM, Marco Guazzone<ma...@gmail.com> wrote:
> On Mon, Jun 8, 2009 at 1:07 AM, Mark Thomas<ma...@apache.org> wrote:
>> ...
>> Just followed through the source code and found a handy comment (yes they really
>> do exist) pointing me towards section JSP.2.2 of the JSP spec. This makes it
>> clear that #{...} is not allowed in template text so unless I am mis-reading
>> your original example you are trying to use #{...} in template text so that is
>> not permitted by the spec. That it working prior to 6.0.20 appears to be a
>> side-effect of the bug fix Chuck already identified.
>>
>> What does seem wrong is that JSP.2.2 requires a translation error is you use
>> #{...} in template text and that doesn't seem to be happening. That is worth
>> creating a bug for, so please go ahead so it doesn't get forgotten about.
>>
>
> Thanks to all!
>
> I suspected that the 6.0.20 behavior was right (wrt to the 6.0.18 one)
> after reading Section 1.2.4 of "JavaServer Pages 2.1 Expression
> Language Specification"...
> ... And now you confirm this.
>
> In effect there is no error message in the Tomcat log.
> So I'm going to submit a bug for this.

New bug reported.
Link to bugzilla:

https://issues.apache.org/bugzilla/show_bug.cgi?id=47331

Ciao!!

-- Marco

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


Re: Update to 6.0.20: deferred EL expressions

Posted by Marco Guazzone <ma...@gmail.com>.
On Mon, Jun 8, 2009 at 1:07 AM, Mark Thomas<ma...@apache.org> wrote:
> ...
> Just followed through the source code and found a handy comment (yes they really
> do exist) pointing me towards section JSP.2.2 of the JSP spec. This makes it
> clear that #{...} is not allowed in template text so unless I am mis-reading
> your original example you are trying to use #{...} in template text so that is
> not permitted by the spec. That it working prior to 6.0.20 appears to be a
> side-effect of the bug fix Chuck already identified.
>
> What does seem wrong is that JSP.2.2 requires a translation error is you use
> #{...} in template text and that doesn't seem to be happening. That is worth
> creating a bug for, so please go ahead so it doesn't get forgotten about.
>

Thanks to all!

I suspected that the 6.0.20 behavior was right (wrt to the 6.0.18 one)
after reading Section 1.2.4 of "JavaServer Pages 2.1 Expression
Language Specification"...
... And now you confirm this.

In effect there is no error message in the Tomcat log.
So I'm going to submit a bug for this.

Again, thank you very much for the support!!

Ciao!!

-- Marco

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


RE: Update to 6.0.20: deferred EL expressions

Posted by Martin Gainty <mg...@hotmail.com>.
package org.apache.el.parser;
import javax.el.ELException;
import javax.el.MethodInfo;
import org.apache.el.lang.EvaluationContext;
/* All AST nodes must implement this interface.  It provides basic
   machinery for constructing the parent and child relationships
   between nodes. */

/*** @author Jacob Hookom [jacob@hookom.net]
 * @version $Change: 181177 $$DateTime: 2001/06/26 08:45:09 $$Author: markt $
 *MG>hard to believe this is the most recent!
 */
public interface Node {
//important stuff
public Class getType(org.apache.el.lang.EvaluationContext ctx) throws ELException;
//more important stuff
//getType() method with no parameters not in this distro
}

//you *may* need to construct the org.apache.el.lang.EvaluationContext before getType
//here is the constructor for EvaluationContext
    public EvaluationContext(ELContext elContext, FunctionMapper fnMapper,
            VariableMapper varMapper) {
        this.elContext = elContext;
        this.fnMapper = fnMapper;
        this.varMapper = varMapper;
    }
?
Martin 
______________________________________________ 
Jogi és Bizalmassági kinyilatkoztatás/Verzicht und Vertraulichkeitanmerkung/Note de déni et de confidentialité
 Ez az
üzenet bizalmas.  Ha nem ön az akinek szánva volt, akkor kérjük, hogy
jelentse azt nekünk vissza. Semmiféle továbbítása vagy másolatának
készítése nem megengedett.  Ez az üzenet csak ismeret cserét szolgál és
semmiféle jogi alkalmazhatósága sincs.  Mivel az electronikus üzenetek
könnyen megváltoztathatóak, ezért minket semmi felelöség nem terhelhet
ezen üzenet tartalma miatt.

Diese Nachricht ist vertraulich. Sollten Sie nicht der vorgesehene Empfaenger sein, so bitten wir hoeflich um eine Mitteilung. Jede unbefugte Weiterleitung oder Fertigung einer Kopie ist unzulaessig. Diese Nachricht dient lediglich dem Austausch von Informationen und entfaltet keine rechtliche Bindungswirkung. Aufgrund der leichten Manipulierbarkeit von E-Mails koennen wir keine Haftung fuer den Inhalt uebernehmen.
Ce message est confidentiel et peut être privilégié. Si vous n'êtes pas le destinataire prévu, nous te demandons avec bonté que pour satisfaire informez l'expéditeur. N'importe quelle diffusion non autorisée ou la copie de ceci est interdite. Ce message sert à l'information seulement et n'aura pas n'importe quel effet légalement obligatoire. Étant donné que les email peuvent facilement être sujets à la manipulation, nous ne pouvons accepter aucune responsabilité pour le contenu fourni.




> From: Chuck.Caldarale@unisys.com
> To: users@tomcat.apache.org
> Date: Sun, 7 Jun 2009 15:24:18 -0500
> Subject: RE: Update to 6.0.20: deferred EL expressions
> 
> > From: Caldarale, Charles R [mailto:Chuck.Caldarale@unisys.com]
> > Subject: RE: Update to 6.0.20: deferred EL expressions
> > 
> > I've verified your observations by fiddling with one of the 
> > JSP examples that come with Tomcat; it does seem like a bug
> > in 6.0.20 at this point.  Will need to do some more digging.
> 
> I've patched org/apache/jasper/compiler/Generator.java to produce the same behavior in 6.0.20 as was available in 6.0.18, at least for my test case.  I can't say I'm happy with the fix, since I don't understand why it's needed; something else that I haven't found has changed, so this is really just addressing the symptom, not the underlying cause.  If you file a bug report, I suspect Mark T will be able to prepare a better fix.
> 
> If the attachment doesn't make it through, here's the change, lines 962-967:
> 
> old code:
>             if (!pageInfo.isELIgnored() && (n.getEL() != null)) {
>                 out.printil("out.write("
>                         + JspUtil.interpreterCall(this.isTagFile, n.getType() + "{"
>                                 + new String(n.getText()) + "}", String.class,
>                                 n.getEL().getMapName(), false) + ");");
>             } else {
> 
> new code:
>             if (!pageInfo.isELIgnored() && (n.getEL() != null || n.getType() == '#')) {
>                 out.printil("out.write("
>                         + JspUtil.interpreterCall(this.isTagFile, n.getType() + "{"
>                                 + new String(n.getText()) + "}", String.class,
>                                 n.getType() == '#' ? "null" : n.getEL().getMapName(), false) + ");");
>             } else {
> 
> Only lines 962 and 966 were changed; the others are provided for context.
> 
>  - Chuck
> 
> 
> THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY MATERIAL and is thus for use only by the intended recipient. If you received this in error, please contact the sender and delete the e-mail and its attachments from all computers.
> 

_________________________________________________________________
Windows Live™ SkyDrive™: Get 25 GB of free online storage.
http://windowslive.com/online/skydrive?ocid=TXT_TAGLM_WL_SD_25GB_062009

Re: Update to 6.0.20: deferred EL expressions

Posted by Mark Thomas <ma...@apache.org>.
Caldarale, Charles R wrote:
>> From: Caldarale, Charles R [mailto:Chuck.Caldarale@unisys.com]
>> Subject: RE: Update to 6.0.20: deferred EL expressions
>>
>> I've verified your observations by fiddling with one of the 
>> JSP examples that come with Tomcat; it does seem like a bug
>> in 6.0.20 at this point.  Will need to do some more digging.
> 
> I've patched org/apache/jasper/compiler/Generator.java to produce the same behavior in 6.0.20 as was available in 6.0.18, at least for my test case.  I can't say I'm happy with the fix, since I don't understand why it's needed; something else that I haven't found has changed, so this is really just addressing the symptom, not the underlying cause.  If you file a bug report, I suspect Mark T will be able to prepare a better fix.

Just followed through the source code and found a handy comment (yes they really
do exist) pointing me towards section JSP.2.2 of the JSP spec. This makes it
clear that #{...} is not allowed in template text so unless I am mis-reading
your original example you are trying to use #{...} in template text so that is
not permitted by the spec. That it working prior to 6.0.20 appears to be a
side-effect of the bug fix Chuck already identified.

What does seem wrong is that JSP.2.2 requires a translation error is you use
#{...} in template text and that doesn't seem to be happening. That is worth
creating a bug for, so please go ahead so it doesn't get forgotten about.

Mark

> 
> If the attachment doesn't make it through, here's the change, lines 962-967:
> 
> old code:
>             if (!pageInfo.isELIgnored() && (n.getEL() != null)) {
>                 out.printil("out.write("
>                         + JspUtil.interpreterCall(this.isTagFile, n.getType() + "{"
>                                 + new String(n.getText()) + "}", String.class,
>                                 n.getEL().getMapName(), false) + ");");
>             } else {
> 
> new code:
>             if (!pageInfo.isELIgnored() && (n.getEL() != null || n.getType() == '#')) {
>                 out.printil("out.write("
>                         + JspUtil.interpreterCall(this.isTagFile, n.getType() + "{"
>                                 + new String(n.getText()) + "}", String.class,
>                                 n.getType() == '#' ? "null" : n.getEL().getMapName(), false) + ");");
>             } else {
> 
> Only lines 962 and 966 were changed; the others are provided for context.
> 
>  - Chuck
> 
> 
> THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY MATERIAL and is thus for use only by the intended recipient. If you received this in error, please contact the sender and delete the e-mail and its attachments from all computers.
> 
> 
> 
> ------------------------------------------------------------------------
> 
> 
> ---------------------------------------------------------------------
> 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: Update to 6.0.20: deferred EL expressions

Posted by "Caldarale, Charles R" <Ch...@unisys.com>.
> From: Caldarale, Charles R [mailto:Chuck.Caldarale@unisys.com]
> Subject: RE: Update to 6.0.20: deferred EL expressions
> 
> I've verified your observations by fiddling with one of the 
> JSP examples that come with Tomcat; it does seem like a bug
> in 6.0.20 at this point.  Will need to do some more digging.

I've patched org/apache/jasper/compiler/Generator.java to produce the same behavior in 6.0.20 as was available in 6.0.18, at least for my test case.  I can't say I'm happy with the fix, since I don't understand why it's needed; something else that I haven't found has changed, so this is really just addressing the symptom, not the underlying cause.  If you file a bug report, I suspect Mark T will be able to prepare a better fix.

If the attachment doesn't make it through, here's the change, lines 962-967:

old code:
            if (!pageInfo.isELIgnored() && (n.getEL() != null)) {
                out.printil("out.write("
                        + JspUtil.interpreterCall(this.isTagFile, n.getType() + "{"
                                + new String(n.getText()) + "}", String.class,
                                n.getEL().getMapName(), false) + ");");
            } else {

new code:
            if (!pageInfo.isELIgnored() && (n.getEL() != null || n.getType() == '#')) {
                out.printil("out.write("
                        + JspUtil.interpreterCall(this.isTagFile, n.getType() + "{"
                                + new String(n.getText()) + "}", String.class,
                                n.getType() == '#' ? "null" : n.getEL().getMapName(), false) + ");");
            } else {

Only lines 962 and 966 were changed; the others are provided for context.

 - Chuck


THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY MATERIAL and is thus for use only by the intended recipient. If you received this in error, please contact the sender and delete the e-mail and its attachments from all computers.


RE: Update to 6.0.20: deferred EL expressions

Posted by "Caldarale, Charles R" <Ch...@unisys.com>.
> From: Marco Guazzone [mailto:marco.guazzone@gmail.com]
> Subject: Re: Update to 6.0.20: deferred EL expressions
> 
> I've read the description of the aobe bug, but, sorry, I don't
> understand how this applies to my problem.

Because I suspect that's the fix that changed the behavior.  I've verified your observations by fiddling with one of the JSP examples that come with Tomcat; it does seem like a bug in 6.0.20 at this point.  Will need to do some more digging.

 - Chuck


THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY MATERIAL and is thus for use only by the intended recipient. If you received this in error, please contact the sender and delete the e-mail and its attachments from all computers.


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


Re: Update to 6.0.20: deferred EL expressions

Posted by Marco Guazzone <ma...@gmail.com>.
On Sun, Jun 7, 2009 at 4:16 PM, Caldarale, Charles
R<Ch...@unisys.com> wrote:
>> From: Marco Guazzone [mailto:marco.guazzone@gmail.com]
>> Subject: Update to 6.0.20: deferred EL expressions
>>
>> The behavior of Tomcat 6.0.20 seems to be the right one
>> (while 6.0.18 was wrong).
>
> From the changelog, it appears to be related to this:
> https://issues.apache.org/bugzilla/show_bug.cgi?id=36923
>
> The above fix went into 6.0.19, along with quite a bit of other work in Jasper:
> http://tomcat.apache.org/tomcat-6.0-doc/changelog.html
>

Thank you!
I've read the description of the aobe bug, but, sorry, I don't
understand how this applies to my problem.

With Tomcat 6.0.18 the code snip I've posted would be rendered as (for
clarification, I add more context around the code snip):

--- [snip] ---
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<!-- ... -->

<link rel="stylesheet"
href="/my-web-app/resources/theme/current/css/screen.css"
type="text/css" />
<link rel="shortcut icon"
href="/my-web-app/resources/theme/current/img/favicon.ico"
type="image/x-icon"/>

</head>
<!-- ... -->
</html>.
--- [/snip] ---

Instead with Tomcat 6.0.20:

--- [snip] ---
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<!-- ... -->

<link rel="stylesheet"
href="#{facesContext.externalContext.requestContextPath}/resources/theme/current/css/screen.css"
type="text/css" />
<link rel="shortcut icon"
href="#{facesContext.externalContext.requestContextPath}/resources/theme/current/img/favicon.ico"
type="image/x-icon"/>

</head>
<!-- ... -->
</html>.
--- [/snip] ---

Could you tell me if the Tomcat 6.0.20 behavior  is the right one?

NOTE: in my first email I referrend to Section 1.2.4 of JSP 2.1 specs.
Actually I meant the Section 1.2.4 of "JavaServer Pages 2.1 Expression
Language Specification".

Thank you very much!!

Cheers!!

-- Marco

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


RE: Update to 6.0.20: deferred EL expressions

Posted by "Caldarale, Charles R" <Ch...@unisys.com>.
> From: Marco Guazzone [mailto:marco.guazzone@gmail.com]
> Subject: Update to 6.0.20: deferred EL expressions
> 
> The behavior of Tomcat 6.0.20 seems to be the right one 
> (while 6.0.18 was wrong).

>From the changelog, it appears to be related to this:
https://issues.apache.org/bugzilla/show_bug.cgi?id=36923

The above fix went into 6.0.19, along with quite a bit of other work in Jasper:
http://tomcat.apache.org/tomcat-6.0-doc/changelog.html

 - Chuck


THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY MATERIAL and is thus for use only by the intended recipient. If you received this in error, please contact the sender and delete the e-mail and its attachments from all computers.


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