Jan Luehe wrote:
[EMAIL PROTECTED] wrote:

luehe 2004/02/03 12:20:19

  Modified:    jasper2/src/share/org/apache/jasper/compiler
                        TagLibraryInfoImpl.java
  Log:
  Convert selected tag attribute types to their Fully-Qualified-Name
  equivalents if the taglib is JSP 1.2 based.
    This has been discussed with Mark Roth, the JSP spec lead, and will
  allow JSP 1.2 taglibs to continue to work on Tomcat 5. Notice that JSP
  1.2 did not require that tag attribute types be specified using their
  fully-qualified class names. This restriction was added in Tomcat 5.


I meant: JSP 2.0.

Just to be clear: I meant the restriction was added to JSP 2.0 (and implemented by Tomcat 5, of course).

Sorry if there was any confusion. :)

Jan



Jan


Revision Changes Path
1.52 +22 -7 jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/compiler/TagLibraryInfoImpl.java


Index: TagLibraryInfoImpl.java
===================================================================
RCS file: /home/cvs/jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/compiler/TagLibraryInfoImpl.java,v


retrieving revision 1.51
retrieving revision 1.52
diff -u -r1.51 -r1.52
--- TagLibraryInfoImpl.java 7 Jan 2004 00:37:47 -0000 1.51
+++ TagLibraryInfoImpl.java 3 Feb 2004 20:20:19 -0000 1.52
@@ -288,7 +288,7 @@
else if ("validator".equals(tname))
this.tagLibraryValidator = createValidator(element);
else if ("tag".equals(tname))
- tagVector.addElement(createTagInfo(element));
+ tagVector.addElement(createTagInfo(element, jspversion));
else if ("tag-file".equals(tname)) {
TagFileInfo tagFileInfo = createTagFileInfo(element, uri,
jarFileUrl);
@@ -382,7 +382,9 @@
return location;
}
- private TagInfo createTagInfo(TreeNode elem) throws JasperException {
+ private TagInfo createTagInfo(TreeNode elem, String jspVersion)
+ throws JasperException {
+
String tagName = null;
String tagClassName = null;
String teiClassName = null;
@@ -430,7 +432,7 @@
} else if ("variable".equals(tname)) {
variableVector.addElement(createVariable(element));
} else if ("attribute".equals(tname)) {
- attributeVector.addElement(createAttribute(element));
+ attributeVector.addElement(createAttribute(element, jspVersion));
} else if ("dynamic-attributes".equals(tname)) {
dynamicAttributes = JspUtil.booleanValue(element.getBody());
} else if ("example".equals(tname)) {
@@ -526,7 +528,7 @@
return new TagFileInfo(name, path, tagInfo);
}
- TagAttributeInfo createAttribute(TreeNode elem) {
+ TagAttributeInfo createAttribute(TreeNode elem, String jspVersion) {
String name = null;
String type = null;
boolean required = false, rtexprvalue = false, reqTime = false,
@@ -549,6 +551,19 @@
rtexprvalue = JspUtil.booleanValue(s);
} else if ("type".equals(tname)) {
type = element.getBody();
+ if ("1.2".equals(jspVersion)
+ && (type.equals("Boolean")
+ || type.equals("Byte")
+ || type.equals("Character")
+ || type.equals("Double")
+ || type.equals("Float")
+ || type.equals("Integer")
+ || type.equals("Long")
+ || type.equals("Object")
+ || type.equals("Short")
+ || type.equals("String"))) {
+ type = "java.lang." + type;
+ }
} else if ("fragment".equals(tname)) {
String s = element.getBody();
if (s != null)
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]







--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]



Reply via email to