Summary: | Processing of java.io.Reader in "Out" tagplugin | ||
---|---|---|---|
Product: | Tomcat 7 | Reporter: | Konstantin Kolinko <knst.kolinko> |
Component: | Jasper | Assignee: | Tomcat Developers Mailing List <dev> |
Status: | RESOLVED FIXED | ||
Severity: | minor | ||
Priority: | P2 | ||
Version: | 7.0.32 | ||
Target Milestone: | --- | ||
Hardware: | PC | ||
OS: | Windows XP |
Description
Konstantin Kolinko
2012-11-14 08:38:29 UTC
3. JSTL spec says (under "Null & Error Handling"): "If no default value is specified, it itself defaults to an empty string." In the current code: a) A null is used instead of "" as the value of strDefName. b) I suspect that the following check for "no default value specified" is incorrect: ctxt.generateJavaSource("if("); ctxt.generateAttribute("default"); ctxt.generateJavaSource(" != null){"); One has to check whether the attribute is present, instead of checking whether its value is null. (In reply to comment #1) > One has to check whether the attribute is present, instead of checking > whether its value is null. Actually checking for null should be OK here. Apache implementation of JSTL tests for null there. "if (def != null)" on line 100 in http://svn.apache.org/viewvc/tomcat/taglibs/standard/tags/standard-112/src/org/apache/taglibs/standard/tag/common/core/OutSupport.java?view=markup 4. If default is not specified, the body of the tag has to be used as the default value. This feature was completely broken by r1401816 as the following lines were removed: - ctxt.generateJavaSource(" }else{"); - ctxt.generateBody(); - ctxt.generateJavaSource(" }"); I've fixed using body as the default issue in trunk and 7.0.x. Fixed in trunk and 7.0.x and will be included in 7.0.33 onwards. |