Summary: | "deferred" expression fails if <jsp-version> less than 2.0 | ||
---|---|---|---|
Product: | Tomcat 6 | Reporter: | Stan Silvert <stan> |
Component: | Jasper | Assignee: | Tomcat Developers Mailing List <dev> |
Status: | RESOLVED FIXED | ||
Severity: | normal | ||
Priority: | P2 | ||
Version: | 6.0.0 | ||
Target Milestone: | default | ||
Hardware: | Other | ||
OS: | other | ||
Attachments: | war for testing |
Description
Stan Silvert
2006-12-04 13:57:47 UTC
Created attachment 19215 [details]
war for testing
I am not totally convinced this is really a bug. Maybe. Elsewhere in the class, there's a check for 1.2 and 2.0, which seems more accurate (and easier). You could also say: boolean checkDeferred = (!version.equals("1.2") && !version.equals("2.0")) That takes advantage of the fact that 1.2,2.0, and 2.1 are the only versions where the <jsp-version> tag was defined. However, doing it that way doesn't allow someone to say <jsp-version>1.1</jsp-version>. Maybe it shouldn't be allowed so you throw an error in that case? As for it being a bug, I'm quite certain. An application written for JSP 1.2 should run the same in JSP 2.1. As of now, that is not true for taglibs with <jsp-version>1.2</jsp-version>. Backward compatibility is broken if an attribute value starts with "#{". Just try the WAR in Tomcat 5.5 and you will see that it works. BTW, I suspect that this code in Validator.java is wrong as well (and I don't mean just the JSP 2.2 comment (-: ) // JSP.2.2 - '#{' not allowed in template text if (n.getType() == '#') { if (!pageInfo.isDeferredSyntaxAllowedAsLiteral() && (tagInfo == null || ((tagInfo != null) && !tagInfo.getTagLibrary().getRequiredVersion().equals("2.0")))) { err.jspError(n, "jsp.error.el.template.deferred"); } else { return; } } I don't really see what these old tags should do with new pages and EL. Maybe it's supposed to remain compatible, but it does not make that much sense to me. It's fixed now. FYI The old JSF tags processed the EL themselves. That's the root of the problem. So for an Ajax4JSF tag might look like this: <a4j:commandButton actionListener="#{mybean.action}"/> The tag would delegate to JSF 1.1 for processing the EL. This component still works in JSF 1.2 but now JSF 1.2 delegates back to the EL impl included in JSP 2.1. So, the old JSF tags need #{mybean.action} to be passed in as a simple String instead of a MethodExpression or ValueExpression object. |