You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Harald Henkel <H....@GS-automation.DE> on 2007/11/14 14:26:19 UTC

JasperException in Tomcat 5.0 and above but not in 4.1

Hello everybody.

We are still using Tomcat 4.1 and JDK 1.4.2 for a web application.
I'm trying to modernize this now and switch to Tomcat 5.x or 6 and
JRE/JDK 1.6 (Java 6).

While I was successful with Tomcat 4.1 and JDK 1.6, whenever I try to
use Tomcat 5.x or 6, I receive error messages like below, when pushing a
button (which will call a new page) in most of our "wizard" dialogs.

I changed web.xml to refer to web-app version 2.4 (.../web-app_2_4.xsd).

The error messages look like this:

org.apache.jasper.JasperException:
/wizard/manualAssignment/assignOrder.jsp(76,0) The name attribute of the
jsp:param standard action does not accept any expressions
at
org.apache.jasper.compiler.DefaultErrorHandler.jspError(DefaultErrorHandler.java:39) 

at
org.apache.jasper.compiler.ErrorDispatcher.dispatch(ErrorDispatcher.java:409) 

at
org.apache.jasper.compiler.ErrorDispatcher.jspError(ErrorDispatcher.java:238) 

at
org.apache.jasper.compiler.Validator$ValidateVisitor.throwErrorIfExpression(Validator.java:1157) 

at
org.apache.jasper.compiler.Validator$ValidateVisitor.visit(Validator.java:423) 

at org.apache.jasper.compiler.Node$ParamAction.accept(Node.java:927) at
org.apache.jasper.compiler.Node$Nodes.visit(Node.java:2163) at
org.apache.jasper.compiler.Node$Visitor.visitBody(Node.java:2213) at
org.apache.jasper.compiler.Validator$ValidateVisitor.visit(Validator.java:446) 

at org.apache.jasper.compiler.Node$IncludeAction.accept(Node.java:1002)
at org.apache.jasper.compiler.Node$Nodes.visit(Node.java:2163) at
org.apache.jasper.compiler.Node$Visitor.visitBody(Node.java:2213) at
org.apache.jasper.compiler.Validator$ValidateVisitor.visit(Validator.java:716) 

at org.apache.jasper.compiler.Node$CustomTag.accept(Node.java:1441) at
org.apache.jasper.compiler.Node$Nodes.visit(Node.java:2163) at
org.apache.jasper.compiler.Node$Visitor.visitBody(Node.java:2213) at
org.apache.jasper.compiler.Node$Visitor.visit(Node.java:2219) at
org.apache.jasper.compiler.Node$Root.accept(Node.java:456) at
org.apache.jasper.compiler.Node$Nodes.visit(Node.java:2163) at
org.apache.jasper.compiler.Validator.validate(Validator.java:1475) at
org.apache.jasper.compiler.Compiler.generateJava(Compiler.java:214) at
org.apache.jasper.compiler.Compiler.compile(Compiler.java:495)
.....

When I look into that file (assignOrder.jsp) there is - in line 77 -
after an <jsp:include ...> in line 76 a
<jsp:param name="<%= [some variable] %>" value="<%= [some expression ] %>"/>

Isn't this possible in Tomcat 5 and above?
Why?

I found some spec for jsp:param where it was explicity stated,
that "value" can be an <%= %> expression, but "name" cannot ... for JSP
1.2 which was used by Tomcat 4.1.

So is Tomcat 5.x and above just more strict in checking this?
Is there a way to tell Tomcat 5.x/6 to be "compatible" to Tomcat 4.1 (be
less strict)?

Thanks for any help!

With kind regards,
Harald Henkel
GS automation GmbH




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


Re: JasperException in Tomcat 5.0 and above but not in 4.1

Posted by Christopher Schultz <ch...@christopherschultz.net>.
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Harald,

Harald Henkel wrote:
> I found some spec for jsp:param where it was explicity stated,
> that "value" can be an <%= %> expression, but "name" cannot ... for JSP
> 1.2 which was used by Tomcat 4.1.
> 
> So is Tomcat 5.x and above just more strict in checking this?

This seems likely. A lot of things became more strict in Tomcat 5.x...
lots of little details that were allowed but didn't follow the
specification were "fixed".

> Is there a way to tell Tomcat 5.x/6 to be "compatible" to Tomcat 4.1 (be
> less strict)?

My guess is that this is not possible. You might consider asking on the
Tomcat-dev mailing list if this would be a reasonable configurable
setting -- something like "strictServletSpecificationAdherence=false" or
something like that. My guess is that the request will be rejected,
though, since Tomcat is supposed to be the reference implementation for
the specification.

- -chris

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.7 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFHOy+m9CaO5/Lv0PARAmEKAKCVaGSgV/MNbuABnFCGA4p7MpAvTACgwtr/
1jta2/2ri/N9uxOnUwsxfPo=
=cVE8
-----END PGP SIGNATURE-----

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


Re: JasperException in Tomcat 5.0 and above but not in 4.1

Posted by mg...@hotmail.com.
Henkel-

web.xml will need to map xsd to some known mime-type e.g.
  <mime-mapping>
    <extension>xsd</extension>
    <mime-type>text/xml</mime-type>
  </mime-mapping>

Also I would look at
ValidateVisitor.visit(Validator.java:423)
for any expressions which you are currently not handling
(Velocity/Freemarker comes to mind)

Martin--
----- Original Message -----
Wrom: NHGSWZIDREXCAXZOWCONEUQZAAFXISHJEXXIMQZUIVO
To: "Tomcat Users List" <us...@tomcat.apache.org>
Sent: Wednesday, November 14, 2007 8:26 AM
Subject: JasperException in Tomcat 5.0 and above but not in 4.1


> Hello everybody.
>
> We are still using Tomcat 4.1 and JDK 1.4.2 for a web application.
> I'm trying to modernize this now and switch to Tomcat 5.x or 6 and
> JRE/JDK 1.6 (Java 6).
>
> While I was successful with Tomcat 4.1 and JDK 1.6, whenever I try to
> use Tomcat 5.x or 6, I receive error messages like below, when pushing a
> button (which will call a new page) in most of our "wizard" dialogs.
>
> I changed web.xml to refer to web-app version 2.4 (.../web-app_2_4.xsd).
>
> The error messages look like this:
>
> org.apache.jasper.JasperException:
> /wizard/manualAssignment/assignOrder.jsp(76,0) The name attribute of the
> jsp:param standard action does not accept any expressions
> at
>
org.apache.jasper.compiler.DefaultErrorHandler.jspError(DefaultErrorHandler.
java:39)
>
> at
>
org.apache.jasper.compiler.ErrorDispatcher.dispatch(ErrorDispatcher.java:409
)
>
> at
>
org.apache.jasper.compiler.ErrorDispatcher.jspError(ErrorDispatcher.java:238
)
>
> at
>
org.apache.jasper.compiler.Validator$ValidateVisitor.throwErrorIfExpression(
Validator.java:1157)
>
> at
>
org.apache.jasper.compiler.Validator$ValidateVisitor.visit(Validator.java:42
3)
>
> at org.apache.jasper.compiler.Node$ParamAction.accept(Node.java:927) at
> org.apache.jasper.compiler.Node$Nodes.visit(Node.java:2163) at
> org.apache.jasper.compiler.Node$Visitor.visitBody(Node.java:2213) at
>
org.apache.jasper.compiler.Validator$ValidateVisitor.visit(Validator.java:44
6)
>
> at org.apache.jasper.compiler.Node$IncludeAction.accept(Node.java:1002)
> at org.apache.jasper.compiler.Node$Nodes.visit(Node.java:2163) at
> org.apache.jasper.compiler.Node$Visitor.visitBody(Node.java:2213) at
>
org.apache.jasper.compiler.Validator$ValidateVisitor.visit(Validator.java:71
6)
>
> at org.apache.jasper.compiler.Node$CustomTag.accept(Node.java:1441) at
> org.apache.jasper.compiler.Node$Nodes.visit(Node.java:2163) at
> org.apache.jasper.compiler.Node$Visitor.visitBody(Node.java:2213) at
> org.apache.jasper.compiler.Node$Visitor.visit(Node.java:2219) at
> org.apache.jasper.compiler.Node$Root.accept(Node.java:456) at
> org.apache.jasper.compiler.Node$Nodes.visit(Node.java:2163) at
> org.apache.jasper.compiler.Validator.validate(Validator.java:1475) at
> org.apache.jasper.compiler.Compiler.generateJava(Compiler.java:214) at
> org.apache.jasper.compiler.Compiler.compile(Compiler.java:495)
> .....
>
> When I look into that file (assignOrder.jsp) there is - in line 77 -
> after an <jsp:include ...> in line 76 a
> <jsp:param name="<%= [some variable] %>" value="<%= [some expression ]
%>"/>
>
> Isn't this possible in Tomcat 5 and above?
> Why?
>
> I found some spec for jsp:param where it was explicity stated,
> that "value" can be an <%= %> expression, but "name" cannot ... for JSP
> 1.2 which was used by Tomcat 4.1.
>
> So is Tomcat 5.x and above just more strict in checking this?
> Is there a way to tell Tomcat 5.x/6 to be "compatible" to Tomcat 4.1 (be
> less strict)?
>
> Thanks for any help!
>
> With kind regards,
> Harald Henkel
> GS automation GmbH
>
>
>
>
> ---------------------------------------------------------------------
> To start a new topic, e-mail: users@tomcat.apache.org
> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org
>
>


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