|
Mantis - Resin
|
|||||
| Viewing Issue Advanced Details | |||||
|
|
|||||
| ID: | Category: | Severity: | Reproducibility: | Date Submitted: | Last Update: |
| 387 | minor | always | 09-16-05 00:00 | 11-30-05 14:42 | |
|
|
|||||
| Reporter: | user391 | Platform: | |||
| Assigned To: | OS: | ||||
| Priority: | normal | OS Version: | |||
| Status: | closed | Product Version: | 3.0.14 | ||
| Product Build: | 3.0.14 | Resolution: | fixed | ||
| Projection: | none | ||||
| ETA: | none | Fixed in Version: | 3.0.15 | ||
|
|
|||||
| Summary: | 0000387: Cannot create JSP 2.0 .tag file with "class" attribute | ||||
| Description: |
RSN-433 Given the following JSP 2.0 tag file: --- <%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" [^] %> <%@ attribute name="url" required="true"%> <%@ attribute name="class" required="false"%> <%@ attribute name="width" required="false"%> <%@ attribute name="height" required="false"%> <c:if test="${empty width}"><c:set var="width" value="600"/></c:if> <c:if test="${empty height}"><c:set var="height" value="400"/></c:if> <a href="openPopup('${url}', 'popup', 'width=${width},height=${height},directories=no,location=no,menubar=no,status=no,toolbar=no')"><jsp:doBody/></a> --- This will result in a compilation error because of the name of the attribute "class" which is a reserved word in Java: <identifier> expected private java.lang.String class; This is because names of attributes are copied verbatim as members of the implementing class. No check for reserved words is done. A solution would be to append a '_' to every member, but with proper setters: public void setClass(String class_) { this.class_ = class_; } If I change the attribute name to "className" everything works as expected. |
||||
| Steps To Reproduce: | |||||
| Additional Information: | Windows XP SP2, Java 1.5 | ||||
| Relationships | |||||
| Attached Files: | |||||
| Notes | |||||
|
|
|||||
|
|
||||