cvs commit: jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/compiler TagLibraryInfoImpl.java

2005-03-23 Thread yoavs
yoavs   2005/03/23 07:41:47

  Modified:webapps/docs changelog.xml
   jasper2/src/share/org/apache/jasper/compiler
TagLibraryInfoImpl.java
  Log:
  Bugzilla 33538.
  
  Revision  ChangesPath
  1.248 +3 -0  jakarta-tomcat-catalina/webapps/docs/changelog.xml
  
  Index: changelog.xml
  ===
  RCS file: /home/cvs/jakarta-tomcat-catalina/webapps/docs/changelog.xml,v
  retrieving revision 1.247
  retrieving revision 1.248
  diff -u -r1.247 -r1.248
  --- changelog.xml 23 Mar 2005 15:30:56 -  1.247
  +++ changelog.xml 23 Mar 2005 15:41:47 -  1.248
  @@ -260,6 +260,9 @@
 
   33373: Fix handling of context classloader in jspc (remm)
 
  +  
  +33538: Ignore example and tag-extension elements in 
TagLibraryInfoImpl. (yoavs)
  +  
   
 
 
  
  
  
  1.58  +4 -0  
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.57
  retrieving revision 1.58
  diff -u -r1.57 -r1.58
  --- TagLibraryInfoImpl.java   21 Mar 2005 15:38:12 -  1.57
  +++ TagLibraryInfoImpl.java   23 Mar 2005 15:41:47 -  1.58
  @@ -473,6 +473,10 @@
   name = child.getBody();
   } else if ("path".equals(tname)) {
   path = child.getBody();
  +} else if ("example".equals(tname)) {
  +// Ignore  element: Bugzilla 33538
  +} else if ("tag-extension".equals(tname)) {
  +// Ignore  element: Bugzilla 33538
   } else {
   if (log.isWarnEnabled()) {
   log.warn(Localizer.getMessage(
  
  
  

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



cvs commit: jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/compiler TagLibraryInfoImpl.java

2004-05-07 Thread luehe
luehe   2004/05/07 12:37:36

  Modified:jasper2/src/share/org/apache/jasper/compiler
TagLibraryInfoImpl.java
  Log:
  Fix for Bugtraq 5043820 ("when fragment element is used, type and
  rtexprvalue are not set correctly")
  
  Patch provided by: [EMAIL PROTECTED]
  
  Revision  ChangesPath
  1.55  +15 -1 
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.54
  retrieving revision 1.55
  diff -u -r1.54 -r1.55
  --- TagLibraryInfoImpl.java   7 May 2004 17:09:53 -   1.54
  +++ TagLibraryInfoImpl.java   7 May 2004 19:37:36 -   1.55
  @@ -532,8 +532,9 @@
   }
   } else if ("fragment".equals(tname)) {
   String s = element.getBody();
  -if (s != null)
  +if (s != null) {
   isFragment = JspUtil.booleanValue(s);
  +}
   } else if ("description".equals(tname) ||// Ignored elements
  false) {
   ;
  @@ -543,6 +544,19 @@
   "jsp.warning.unknown.element.in.attribute", tname));
   }
   }
  +}
  +
  +if (isFragment) {
  +/*
  + * According to JSP.C-3 ("TLD Schema Element Structure - tag"), 
  + * 'type' and 'rtexprvalue' must not be specified if 'fragment'
  + * has been specified (this will be enforced by validating parser).
  + * Also, if 'fragment' is TRUE, 'type' is fixed at
  + * javax.servlet.jsp.tagext.JspFragment, and 'rtexprvalue' is
  + * fixed at true. See also JSP.8.5.2.
  + */
  +type = "javax.servlet.jsp.tagext.JspFragment";
  +rtexprvalue = true;
   }
   
   if (!rtexprvalue) {
  
  
  

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



cvs commit: jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/compiler TagLibraryInfoImpl.java

2004-05-07 Thread luehe
luehe   2004/05/07 10:09:53

  Modified:jasper2/src/share/org/apache/jasper/compiler
TagLibraryInfoImpl.java
  Log:
  Fix for Bugtraq 5043467 ("small-icon and large-icon values are not retrieved")
  
  Patch provided by: [EMAIL PROTECTED]
  
  Revision  ChangesPath
  1.54  +9 -0  
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.53
  retrieving revision 1.54
  diff -u -r1.53 -r1.54
  --- TagLibraryInfoImpl.java   17 Mar 2004 19:23:03 -  1.53
  +++ TagLibraryInfoImpl.java   7 May 2004 17:09:53 -   1.54
  @@ -383,6 +383,15 @@
   smallIcon = element.getBody();
   } else if ("large-icon".equals(tname)) {
   largeIcon = element.getBody();
  +} else if ("icon".equals(tname)) {
  +TreeNode icon = element.findChild("small-icon");
  +if (icon != null) {
  +smallIcon = icon.getBody();
  +}
  +icon = element.findChild("large-icon");
  +if (icon != null) {
  +largeIcon = icon.getBody();
  +}
   } else if ("info".equals(tname) ||
"description".equals(tname)) {
   info = element.getBody();
  
  
  

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



Re: cvs commit: jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/compiler TagLibraryInfoImpl.java

2004-02-03 Thread Jan Luehe
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  ChangesPath
  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.java7 Jan 2004 00:37:47 -1.51
  +++ TagLibraryInfoImpl.java3 Feb 2004 20:20:19 -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]


Re: cvs commit: jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/compiler TagLibraryInfoImpl.java

2004-02-03 Thread Jan Luehe
[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.

Jan


  
  Revision  ChangesPath
  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 -	1.51
  +++ TagLibraryInfoImpl.java	3 Feb 2004 20:20:19 -	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]


cvs commit: jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/compiler TagLibraryInfoImpl.java

2004-02-03 Thread luehe
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.
  
  Revision  ChangesPath
  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 -   1.51
  +++ TagLibraryInfoImpl.java   3 Feb 2004 20:20:19 -   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]



cvs commit: jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/compiler TagLibraryInfoImpl.java

2004-01-03 Thread markt
markt   2004/01/03 04:17:18

  Modified:jasper2/src/share/org/apache/jasper/compiler
TagLibraryInfoImpl.java
  Log:
  - Converting tabs to spaces.
  
  Revision  ChangesPath
  1.49  +191 -190  
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.48
  retrieving revision 1.49
  diff -u -r1.48 -r1.49
  --- TagLibraryInfoImpl.java   23 Sep 2003 01:11:24 -  1.48
  +++ TagLibraryInfoImpl.java   3 Jan 2004 12:17:18 -   1.49
  @@ -171,24 +171,24 @@
* Constructor.
*/
   public TagLibraryInfoImpl(JspCompilationContext ctxt,
  -   ParserController pc,
  -   String prefix, 
  -   String uriIn,
  -   String[] location,
  -   ErrorDispatcher err) throws JasperException {
  +  ParserController pc,
  +  String prefix, 
  +  String uriIn,
  +  String[] location,
  +  ErrorDispatcher err) throws JasperException {
   super(prefix, uriIn);
   
  - this.ctxt = ctxt;
  - this.parserController = pc;
  - this.err = err;
  +this.ctxt = ctxt;
  +this.parserController = pc;
  +this.err = err;
   InputStream in = null;
   JarFile jarFile = null;
   
  - if (location == null) {
  - // The URI points to the TLD itself or to a JAR file in which the
  - // TLD is stored
  - location = generateTLDLocation(uri, ctxt);
  - }
  +if (location == null) {
  +// The URI points to the TLD itself or to a JAR file in which the
  +// TLD is stored
  +location = generateTLDLocation(uri, ctxt);
  +}
   
   try {
   if (!location[0].endsWith("jar")) {
  @@ -201,6 +201,7 @@
   } catch (FileNotFoundException ex) {
   err.jspError("jsp.error.file.not.found", location[0]);
   }
  +
   parseTLD(ctxt, location[0], in, null);
   // Add TLD to dependency list
   PageInfo pageInfo = ctxt.createCompiler().getPageInfo();
  @@ -212,8 +213,8 @@
   try {
   URL jarFileUrl = new URL("jar:" + location[0] + "!/");
   JarURLConnection conn =
  - (JarURLConnection) jarFileUrl.openConnection();
  - conn.setUseCaches(false);
  +(JarURLConnection) jarFileUrl.openConnection();
  +conn.setUseCaches(false);
   conn.connect();
   jarFile = conn.getJarFile();
   ZipEntry jarEntry = jarFile.getEntry(location[1]);
  @@ -247,7 +248,7 @@
* library is not packaged in a JAR
*/
   private void parseTLD(JspCompilationContext ctxt,
  -   String uri, InputStream in, URL jarFileUrl) 
  +  String uri, InputStream in, URL jarFileUrl) 
   throws JasperException
   {
   Vector tagVector = new Vector();
  @@ -258,10 +259,10 @@
   ParserUtils pu = new ParserUtils();
   TreeNode tld = pu.parseXMLDocument(uri, in);
   
  - // Check to see if the  root element contains a 'version'
  - // attribute, which was added in JSP 2.0 to replace the 
  - // subelement
  - this.jspversion = tld.findAttribute("version");
  +// Check to see if the  root element contains a 'version'
  +// attribute, which was added in JSP 2.0 to replace the 
  +// subelement
  +this.jspversion = tld.findAttribute("version");
   
   // Process each child element of our  element
   Iterator list = tld.findChildren();
  @@ -271,10 +272,10 @@
   String tname = element.getName();
   
   if ("tlibversion".equals(tname)// JSP 1.1
  - || "tlib-version".equals(tname)) { // JSP 1.2
  +|| "tlib-version".equals(tname)) { // JSP 1.2
   this.tlibversion = element.getBody();
   } else if ("jspversion".equals(tname)
  - || "jsp-version".equals(tname)) {
  +|| "jsp-version".equals(tname)) {
   this.jspversion = element.getBody();
   } else if ("shortname".equals(tname) ||
"short-name".equals(tname))
  @@ -289,42 +290,42 @@
   else if ("tag".equals(tname))
   tagVector.addElement(c

cvs commit: jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/compiler TagLibraryInfoImpl.java

2003-09-22 Thread luehe
luehe   2003/09/22 18:11:24

  Modified:jasper2/src/share/org/apache/jasper/compiler
TagLibraryInfoImpl.java
  Log:
  Fixed javadocs of parseTLD, which used to return boolean but was changed to void
  
  Revision  ChangesPath
  1.48  +4 -9  
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.47
  retrieving revision 1.48
  diff -u -r1.47 -r1.48
  --- TagLibraryInfoImpl.java   2 Sep 2003 21:39:59 -   1.47
  +++ TagLibraryInfoImpl.java   23 Sep 2003 01:11:24 -  1.48
  @@ -243,13 +243,8 @@
* @param ctxt The JSP compilation context
* @param uri The TLD's uri
* @param in The TLD's input stream
  - * @param jarFile The JAR file containing the TLD, or null if the tag
  + * @param jarFileUrl The JAR file containing the TLD, or null if the tag
* library is not packaged in a JAR
  - *
  - * @return true if jarFile is different from null and the TLD represented
  - * by the given input stream contains one or more tag files packaged in the
  - * given JAR (that is, one or more tag files whose path element starts
  - * with /META-INF/tags), and false otherwise
*/
   private void parseTLD(JspCompilationContext ctxt,
  String uri, InputStream in, URL jarFileUrl) 
  
  
  

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



cvs commit: jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/compiler TagLibraryInfoImpl.java

2003-08-25 Thread luehe
luehe   2003/08/25 12:46:50

  Modified:jasper2/src/share/org/apache/jasper/compiler
TagLibraryInfoImpl.java
  Log:
  Supply taglib's unique id (instead of the value of the uri argument in
  the directive) to the TagLibraryValidator's validate method.
  
  Corresponding correction has been made to the JSP spec.
  
  Revision  ChangesPath
  1.45  +6 -4  
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.44
  retrieving revision 1.45
  diff -u -r1.44 -r1.45
  --- TagLibraryInfoImpl.java   15 Aug 2003 21:01:41 -  1.44
  +++ TagLibraryInfoImpl.java   25 Aug 2003 19:46:50 -  1.45
  @@ -726,7 +726,9 @@
   public ValidationMessage[] validate(PageData thePage) {
TagLibraryValidator tlv = getTagLibraryValidator();
if (tlv == null) return null;
  - return tlv.validate(getPrefixString(), getURI(), thePage);
  + return tlv.validate(getPrefixString(),
  +(getReliableURN() != null) ? getReliableURN() : 
getURI(),
  +thePage);
   }
   
   protected TagLibraryValidator tagLibraryValidator; 
  
  
  

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



cvs commit: jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/compiler TagLibraryInfoImpl.java

2003-08-15 Thread luehe
luehe   2003/08/15 14:01:41

  Modified:jasper2/src/share/org/apache/jasper/compiler
TagLibraryInfoImpl.java
  Log:
  Restored JSP default for 1.2 based tag handlers
  
  Revision  ChangesPath
  1.44  +11 -19
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.43
  retrieving revision 1.44
  diff -u -r1.43 -r1.44
  --- TagLibraryInfoImpl.java   24 Jul 2003 01:17:33 -  1.43
  +++ TagLibraryInfoImpl.java   15 Aug 2003 21:01:41 -  1.44
  @@ -370,7 +370,14 @@
   String tagName = null;
String tagClassName = null;
String teiClassName = null;
  -String bodycontent = null;
  +
  +/*
  + * Default body content for JSP 1.2 tag handlers ( has
  + * become mandatory in JSP 2.0, because the default would be invalid
  + * for simple tag handlers)
  + */
  +String bodycontent = "JSP";
  +
String info = null;
String displayName = null;
String smallIcon = null;
  @@ -420,21 +427,6 @@
  tname));
}
}
  - }
  -
  - // Determine appropriate default value for body-content
  - if (bodycontent == null) {
  -try {
  -Class tagClass = ctxt.getClassLoader().loadClass(tagClassName);
  - if (SimpleTag.class.isAssignableFrom(tagClass)) {
  - bodycontent = TagInfo.BODY_CONTENT_SCRIPTLESS;
  - } else {
  - bodycontent = TagInfo.BODY_CONTENT_JSP;
  - }
  - } catch (Exception e) {
  -err.jspError("jsp.error.loadclass.taghandler", tagClassName,
  -  tagName);
  -}
}
   
   TagExtraInfo tei = null;
  
  
  

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



cvs commit: jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/compiler TagLibraryInfoImpl.java

2003-07-23 Thread luehe
luehe   2003/07/23 18:17:34

  Modified:jasper2/src/share/org/apache/jasper/compiler
TagLibraryInfoImpl.java
  Log:
  Do not unconditionally use "JSP" as the default body-content type,
  because it is illegal for SimpleTag handlers
  
  Revision  ChangesPath
  1.43  +45 -26
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.42
  retrieving revision 1.43
  diff -u -r1.42 -r1.43
  --- TagLibraryInfoImpl.java   21 May 2003 18:09:33 -  1.42
  +++ TagLibraryInfoImpl.java   24 Jul 2003 01:17:33 -  1.43
  @@ -367,10 +367,10 @@
   }
   
   private TagInfo createTagInfo(TreeNode elem) throws JasperException {
  -String name = null;
  - String tagclass = null;
  - String teiclass = null;
  -String bodycontent = "JSP"; // Default body content is JSP
  +String tagName = null;
  + String tagClassName = null;
  + String teiClassName = null;
  +String bodycontent = null;
String info = null;
String displayName = null;
String smallIcon = null;
  @@ -385,13 +385,13 @@
   String tname = element.getName();
   
   if ("name".equals(tname)) {
  -name = element.getBody();
  +tagName = element.getBody();
   } else if ("tagclass".equals(tname) ||
"tag-class".equals(tname)) {
  -tagclass = element.getBody();
  +tagClassName = element.getBody();
   } else if ("teiclass".equals(tname) ||
"tei-class".equals(tname)) {
  -teiclass = element.getBody();
  +teiClassName = element.getBody();
   } else if ("bodycontent".equals(tname) ||
"body-content".equals(tname)) {
   bodycontent = element.getBody();
  @@ -422,32 +422,51 @@
}
}
   
  - TagAttributeInfo[] tagAttributeInfo
  - = new TagAttributeInfo[attributeVector.size()];
  - attributeVector.copyInto(tagAttributeInfo);
  -
  - TagVariableInfo[] tagVariableInfos
  - = new TagVariableInfo[variableVector.size()];
  - variableVector.copyInto(tagVariableInfos);
  + // Determine appropriate default value for body-content
  + if (bodycontent == null) {
  +try {
  +Class tagClass = ctxt.getClassLoader().loadClass(tagClassName);
  + if (SimpleTag.class.isAssignableFrom(tagClass)) {
  + bodycontent = TagInfo.BODY_CONTENT_SCRIPTLESS;
  + } else {
  + bodycontent = TagInfo.BODY_CONTENT_JSP;
  + }
  + } catch (Exception e) {
  +err.jspError("jsp.error.loadclass.taghandler", tagClassName,
  +  tagName);
  +}
  + }
   
   TagExtraInfo tei = null;
  -if (teiclass != null && !teiclass.equals("")) {
  +if (teiClassName != null && !teiClassName.equals("")) {
   try {
  -Class teiClass = ctxt.getClassLoader().loadClass(teiclass);
  +Class teiClass = ctxt.getClassLoader().loadClass(teiClassName);
   tei = (TagExtraInfo) teiClass.newInstance();
} catch (Exception e) {
  -err.jspError("jsp.error.teiclass.instantiation", teiclass, e);
  +err.jspError("jsp.error.teiclass.instantiation", teiClassName,
  +  e);
   }
}
   
  -TagInfo taginfo = new TagInfo(name, tagclass, bodycontent,
  -  info, this, 
  + TagAttributeInfo[] tagAttributeInfo
  + = new TagAttributeInfo[attributeVector.size()];
  + attributeVector.copyInto(tagAttributeInfo);
  +
  + TagVariableInfo[] tagVariableInfos
  + = new TagVariableInfo[variableVector.size()];
  + variableVector.copyInto(tagVariableInfos);
  +
  +TagInfo taginfo = new TagInfo(tagName,
  +  tagClassName,
  +  bodycontent,
  +  info,
  +  this, 
 tei,
 tagAttributeInfo,
  -   displayName,
  -   smallIcon,
  -   largeIcon,
  -   tagVariableInfos,
  +  displayName,
  +  smallIcon,
  +  largeIcon,
  + 

cvs commit: jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/compiler TagLibraryInfoImpl.java TldLocationsCache.java

2003-03-26 Thread luehe
luehe   2003/03/26 12:40:15

  Modified:jasper2/src/share/org/apache/jasper/compiler
TagLibraryInfoImpl.java TldLocationsCache.java
  Log:
  Fixed Bugzilla 15875 ("Support global sharing of tag libraries")
  
  Revision  ChangesPath
  1.36  +4 -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.35
  retrieving revision 1.36
  diff -u -r1.35 -r1.36
  --- TagLibraryInfoImpl.java   21 Feb 2003 18:23:14 -  1.35
  +++ TagLibraryInfoImpl.java   26 Mar 2003 20:40:15 -  1.36
  @@ -206,10 +206,7 @@
ZipEntry jarEntry = null;
InputStream stream = null;
try {
  -String path = location[0] ;
  -url = ctxt.getResource(path);
  -if (url == null) return;
  - url = new URL("jar:" + url.toString() + "!/");
  + url = new URL("jar:" + location[0] + "!/");
JarURLConnection conn = (JarURLConnection)
url.openConnection();
conn.connect(); //@@@ necessary???
  
  
  
  1.14  +108 -72   
jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/compiler/TldLocationsCache.java
  
  Index: TldLocationsCache.java
  ===
  RCS file: 
/home/cvs/jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/compiler/TldLocationsCache.java,v
  retrieving revision 1.13
  retrieving revision 1.14
  diff -u -r1.13 -r1.14
  --- TldLocationsCache.java6 Mar 2003 20:21:45 -   1.13
  +++ TldLocationsCache.java26 Mar 2003 20:40:15 -  1.14
  @@ -58,13 +58,16 @@
   import java.io.FileNotFoundException;
   import java.io.File;
   import java.io.IOException;
  +import java.io.DataInputStream;
   import java.util.Hashtable;
   import java.util.Enumeration;
   import java.util.Iterator;
   import java.util.Set;
   import java.util.jar.*;
   import java.net.JarURLConnection;
  -import java.net.*;
  +import java.net.URLClassLoader;
  +import java.net.URLConnection;
  +import java.net.URL;
   
   import javax.servlet.ServletContext;
   import javax.servlet.jsp.tagext.TagLibraryInfo;
  @@ -147,14 +150,15 @@
   this(ctxt, false);
   }
   
  -/** Constructs a new instance of TldLocationsCache. 
  +/** Constructor. 
  + *
* @param ctxt the servlet context of the web application in which Jasper 
  - *   is running
  + * is running
* @param redeployMode if true, then the compiler will allow redeploying 
  - *   a tag library from the same jar, at the expense of slowing down the server 
  - *   a bit. Note that this may only work on JDK 1.3.1_01a and later, because 
  - *   of JDK bug 4211817 fixed in this release.
  - *   If redeployMode is false, a faster but less capable mode will be used.
  + * a tag library from the same jar, at the expense of slowing down the
  + * server a bit. Note that this may only work on JDK 1.3.1_01a and later,
  + * because of JDK bug 4211817 fixed in this release.
  + * If redeployMode is false, a faster but less capable mode will be used.
*/
   public TldLocationsCache(ServletContext ctxt, boolean redeployMode) {
   this.ctxt = ctxt;
  @@ -164,14 +168,62 @@
   initialized = false;
   }
   
  +/**
  + * Get the 'location' of the TLD associated with 
  + * a given taglib 'uri'.
  + * 
  + * @return An array of two Strings. The first one is
  + * real path to the TLD. If the path to the TLD points
  + * to a jar file, then the second string is the
  + * name of the entry for the TLD in the jar file.
  + * Returns null if the uri is not associated to
  + * a tag library 'exposed' in the web application.
  + * A tag library is 'exposed' either explicitely in 
  + * web.xml or implicitely via the uri tag in the TLD 
  + * of a taglib deployed in a jar file (WEB-INF/lib).
  + */
  +public String[] getLocation(String uri) 
  +throws JasperException
  +{
  +if( ! initialized ) init();
  +return (String[])mappings.get(uri);
  +}
  +
  +/** 
  + * Returns the type of a URI:
  + * ABS_URI
  + * ROOT_REL_URI
  + * NOROOT_REL_URI
  + */
  +public static int uriType(String uri) {
  +if (uri.indexOf(':') != -1) {
  +return ABS_URI;
  +} else if (uri.startsWith("/")) {
  +return ROOT_REL_URI;
  +} else {
  +return NOROOT_REL_URI;
  +}
  +}
  +
  +public TagLibraryInfo getTagLibraryInfo(String uri) {
  +if (!initialized) init();
  +ret

cvs commit: jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/compiler TagLibraryInfoImpl.java

2003-03-02 Thread amyroh
amyroh  2003/03/02 23:51:18

  Modified:jasper2/src/share/org/apache/jasper/compiler Tag:
tomcat_4_branch TagLibraryInfoImpl.java
  Log:
  Apply a patch for bugzilla 14302.
  This "fixes a bug in TagLibraryInfoImpl that currently makes JspC totally
  useless when the application contains tag libraries packaged as JAR files."
  Submitted by Hans Bergsten <[EMAIL PROTECTED]>.
  
  Revision  ChangesPath
  No   revision
  
  
  No   revision
  
  
  1.2.2.1   +142 -146  
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.2
  retrieving revision 1.2.2.1
  diff -u -r1.2 -r1.2.2.1
  --- TagLibraryInfoImpl.java   16 May 2002 20:59:21 -  1.2
  +++ TagLibraryInfoImpl.java   3 Mar 2003 07:51:18 -   1.2.2.1
  @@ -138,93 +138,89 @@
   }
   
   public TagLibraryInfoImpl(JspCompilationContext ctxt, String prefix, 
  -   String uriIn, String[] location,
  -   ErrorDispatcher err) 
  +  String uriIn, String[] location,
  +  ErrorDispatcher err) 
   throws JasperException {
   
   super(prefix, uriIn);
   
  - this.ctxt = ctxt;
  - this.err = err;
  +this.ctxt = ctxt;
  +this.err = err;
   ZipInputStream zin;
   InputStream in = null;
   URL url = null;
   boolean relativeURL = false;
   
  - if (location == null) {
  - // The URI points to the TLD itself or to a jar
  - // file where the TLD is located
  - int uriType = TldLocationsCache.uriType(uri);
  - if (uriType == TldLocationsCache.ABS_URI) {
  - err.jspError("jsp.error.taglibDirective.absUriCannotBeResolved",
  -  uri);
  - } else if (uriType == 
  -TldLocationsCache.NOROOT_REL_URI) {
  - uri = ctxt.resolveRelativeUri(uri);
  - }
  - location = new String[2];
  - location[0] = uri;
  - if (uri.endsWith("jar")) {
  - location[1] = "META-INF/taglib.tld";
  - }
  - }
  +if (location == null) {
  +// The URI points to the TLD itself or to a jar
  +// file where the TLD is located
  +int uriType = TldLocationsCache.uriType(uri);
  +if (uriType == TldLocationsCache.ABS_URI) {
  +err.jspError("jsp.error.taglibDirective.absUriCannotBeResolved",
  +uri);
  +} else if (uriType == 
  +TldLocationsCache.NOROOT_REL_URI) {
  +uri = ctxt.resolveRelativeUri(uri);
  +}
  +location = new String[2];
  +location[0] = uri;
  +if (uri.endsWith("jar")) {
  +location[1] = "META-INF/taglib.tld";
  +}
  +}
   
   if (!location[0].endsWith("jar")) {
  - // Location points to TLD file
  - try {
  - in = getResourceAsStream(location[0]);
  - if (in == null) {
  - throw new FileNotFoundException(location[0]);
  - }
  - } catch (FileNotFoundException ex) {
  - err.jspError("jsp.error.file.not.found", location[0]);
  - }
  - // Now parse the tld.
  - parseTLD(ctxt, location[0], in);
  - } else {
  - // Location points to a jar file
  - // tag library in jar file
  - JarFile jarFile = null;
  - ZipEntry jarEntry = null;
  - InputStream stream = null;
  - try {
  +// Location points to TLD file
  +try {
  +in = getResourceAsStream(location[0]);
  +if (in == null) {
  +throw new FileNotFoundException(location[0]);
  +}
  +} catch (FileNotFoundException ex) {
  +err.jspError("jsp.error.file.not.found", location[0]);
  +}
  +// Now parse the tld.
  +parseTLD(ctxt, location[0], in);
  +} else {
  +// Location points to a jar file
  +// tag library in jar file
  +JarFile jarFile = null;
  +ZipEntry jarEntry = null;
  +InputStream stream = null;
  +try {
   String path = location[0] ;
  -if(ctxt.getClassLoader() != null &&
  -   URLClassLoader.class.equals(ctxt.getClassLoader().getClass())
  -   && path.startsWith("/"))
  -   path = path.substring(1,path.length()) ;
   url = ctxt.getResource

cvs commit: jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/compiler TagLibraryInfoImpl.java

2003-01-13 Thread luehe
luehe   2003/01/13 12:09:46

  Modified:jasper2/src/share/org/apache/jasper/compiler
TagLibraryInfoImpl.java
  Log:
  Added support for new 'version' attribute of  element, which
  has been added in JSP 2.0 to replace the  subelement
  
  Revision  ChangesPath
  1.32  +10 -5 
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.31
  retrieving revision 1.32
  diff -u -r1.31 -r1.32
  --- TagLibraryInfoImpl.java   18 Dec 2002 23:18:21 -  1.31
  +++ TagLibraryInfoImpl.java   13 Jan 2003 20:09:44 -  1.32
  @@ -248,11 +248,16 @@
   // Create an iterator over the child elements of our  element
   ParserUtils pu = new ParserUtils();
   TreeNode tld = pu.parseXMLDocument(uri, in);
  -Iterator list = tld.findChildren();
  +
  + // Check to see if the  root element contains a 'version'
  + // attribute, which was added in JSP 2.0 to replace the 
  + // subelement
  + this.jspversion = tld.findAttribute("version");
   
   // Process each child element of our  element
  -while (list.hasNext()) {
  +Iterator list = tld.findChildren();
   
  +while (list.hasNext()) {
   TreeNode element = (TreeNode) list.next();
   String tname = element.getName();
   
  
  
  

--
To unsubscribe, e-mail:   
For additional commands, e-mail: 




cvs commit: jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/compiler TagLibraryInfoImpl.java

2002-12-16 Thread luehe
luehe   2002/12/16 12:39:17

  Modified:jasper2/src/share/org/apache/jasper/resources
messages.properties
   jasper2/src/share/org/apache/jasper/compiler
TagLibraryInfoImpl.java
  Log:
  Fixed 15404: No error condition raised if mandatory TLD elements
   and  are not present in the TLD
  
  Revision  ChangesPath
  1.73  +2 -2  
jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/resources/messages.properties
  
  Index: messages.properties
  ===
  RCS file: 
/home/cvs/jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/resources/messages.properties,v
  retrieving revision 1.72
  retrieving revision 1.73
  diff -u -r1.72 -r1.73
  --- messages.properties   16 Dec 2002 19:43:53 -  1.72
  +++ messages.properties   16 Dec 2002 20:39:17 -  1.73
  @@ -278,9 +278,9 @@
   jsp.error.tld.fn.invalid.signature.classnotfound=Invalid syntax for function 
signature in TLD.  Class not found: ${0}.  Tag Library: {1}, Function: {2}.
   jsp.error.tld.fn.invalid.signature.commaexpected=Invalid syntax for function 
signature in TLD.  Comma ',' expected.  Tag Library: {0}, Function: {1}.
   jsp.error.tld.fn.invalid.signature.parenexpected=Invalid syntax for function 
signature in TLD.  Parenthesis '(' expected.  Tag Library: {0}, Function: {1}.
  +jsp.error.tld.mandatory.element.missing=Mandatory TLD element missing or empty: {0}
   jsp.error.dynamic.attributes.not.implemented=The {0} tag declares that it accepts 
dynamic attributes but does not implement the required interface
   jsp.error.nomatching.fragment=Cannot find an attribute directive (with name={0} and 
fragment=true) prior to the fragment directive.
  -jsp.error.tld.mandatory.element.missing=Mandatory TLD element missing: {0}
   jsp.error.attribute.noequal=equal symbol expected
   jsp.error.attribute.noquote=quote symbol expected
   jsp.error.attribute.unterminated=attribute for {0} is not properly terminated
  
  
  
  1.30  +5 -9  
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.29
  retrieving revision 1.30
  diff -u -r1.29 -r1.30
  --- TagLibraryInfoImpl.java   16 Dec 2002 19:43:53 -  1.29
  +++ TagLibraryInfoImpl.java   16 Dec 2002 20:39:17 -  1.30
  @@ -244,8 +244,6 @@
   Vector tagVector = new Vector();
   Vector tagFileVector = new Vector();
   Hashtable functionTable = new Hashtable();
  - boolean tlibVersionSeen = false;
  - boolean jspVersionSeen = false;
   
   // Create an iterator over the child elements of our  element
   ParserUtils pu = new ParserUtils();
  @@ -261,11 +259,9 @@
   if ("tlibversion".equals(tname)// JSP 1.1
|| "tlib-version".equals(tname)) { // JSP 1.2
   this.tlibversion = element.getBody();
  - tlibVersionSeen = true;
   } else if ("jspversion".equals(tname)
|| "jsp-version".equals(tname)) {
   this.jspversion = element.getBody();
  - jspVersionSeen = true;
   } else if ("shortname".equals(tname) ||
"short-name".equals(tname))
   this.shortname = element.getBody();
  @@ -306,11 +302,11 @@
   
   }
   
  - if (!tlibVersionSeen) {
  + if (tlibversion == null) {
err.jspError("jsp.error.tld.mandatory.element.missing", 
 "tlib-version");
}
  - if (!jspVersionSeen) {
  + if (jspversion == null) {
err.jspError("jsp.error.tld.mandatory.element.missing",
 "jsp-version");
}
  
  
  

--
To unsubscribe, e-mail:   
For additional commands, e-mail: 




cvs commit: jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/compiler TagLibraryInfoImpl.java

2002-12-16 Thread luehe
luehe   2002/12/16 11:43:54

  Modified:jasper2/src/share/org/apache/jasper/resources
messages.properties
   jasper2/src/share/org/apache/jasper/compiler
TagLibraryInfoImpl.java
  Log:
  Fixed 15404: No error condition raised if mandatory TLD elements
   and  are not present in the TLD
  
  Revision  ChangesPath
  1.72  +2 -1  
jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/resources/messages.properties
  
  Index: messages.properties
  ===
  RCS file: 
/home/cvs/jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/resources/messages.properties,v
  retrieving revision 1.71
  retrieving revision 1.72
  diff -u -r1.71 -r1.72
  --- messages.properties   13 Dec 2002 16:27:43 -  1.71
  +++ messages.properties   16 Dec 2002 19:43:53 -  1.72
  @@ -280,6 +280,7 @@
   jsp.error.tld.fn.invalid.signature.parenexpected=Invalid syntax for function 
signature in TLD.  Parenthesis '(' expected.  Tag Library: {0}, Function: {1}.
   jsp.error.dynamic.attributes.not.implemented=The {0} tag declares that it accepts 
dynamic attributes but does not implement the required interface
   jsp.error.nomatching.fragment=Cannot find an attribute directive (with name={0} and 
fragment=true) prior to the fragment directive.
  +jsp.error.tld.mandatory.element.missing=Mandatory TLD element missing: {0}
   jsp.error.attribute.noequal=equal symbol expected
   jsp.error.attribute.noquote=quote symbol expected
   jsp.error.attribute.unterminated=attribute for {0} is not properly terminated
  
  
  
  1.29  +22 -9 
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.28
  retrieving revision 1.29
  diff -u -r1.28 -r1.29
  --- TagLibraryInfoImpl.java   12 Dec 2002 17:44:38 -  1.28
  +++ TagLibraryInfoImpl.java   16 Dec 2002 19:43:53 -  1.29
  @@ -244,7 +244,9 @@
   Vector tagVector = new Vector();
   Vector tagFileVector = new Vector();
   Hashtable functionTable = new Hashtable();
  - 
  + boolean tlibVersionSeen = false;
  + boolean jspVersionSeen = false;
  +
   // Create an iterator over the child elements of our  element
   ParserUtils pu = new ParserUtils();
   TreeNode tld = pu.parseXMLDocument(uri, in);
  @@ -256,13 +258,15 @@
   TreeNode element = (TreeNode) list.next();
   String tname = element.getName();
   
  -if ("tlibversion".equals(tname) ||  // JSP 1.1
  -"tlib-version".equals(tname))   // JSP 1.2
  +if ("tlibversion".equals(tname)// JSP 1.1
  + || "tlib-version".equals(tname)) { // JSP 1.2
   this.tlibversion = element.getBody();
  -else if ("jspversion".equals(tname) ||
  - "jsp-version".equals(tname))
  + tlibVersionSeen = true;
  +} else if ("jspversion".equals(tname)
  + || "jsp-version".equals(tname)) {
   this.jspversion = element.getBody();
  -else if ("shortname".equals(tname) ||
  + jspVersionSeen = true;
  +} else if ("shortname".equals(tname) ||
"short-name".equals(tname))
   this.shortname = element.getBody();
   else if ("uri".equals(tname))
  @@ -301,6 +305,15 @@
   }
   
   }
  +
  + if (!tlibVersionSeen) {
  + err.jspError("jsp.error.tld.mandatory.element.missing", 
  +  "tlib-version");
  + }
  + if (!jspVersionSeen) {
  + err.jspError("jsp.error.tld.mandatory.element.missing",
  +  "jsp-version");
  + }
   
   this.tags = new TagInfo[tagVector.size()];
   tagVector.copyInto (this.tags);
  
  
  

--
To unsubscribe, e-mail:   
For additional commands, e-mail: 




cvs commit: jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/compiler TagLibraryInfoImpl.java

2002-11-27 Thread luehe
luehe   2002/11/27 08:00:15

  Modified:jasper2/src/share/org/apache/jasper/compiler
TagLibraryInfoImpl.java
  Log:
  small javadoc improvement
  
  Revision  ChangesPath
  1.26  +8 -3  
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.25
  retrieving revision 1.26
  diff -u -r1.25 -r1.26
  --- TagLibraryInfoImpl.java   14 Nov 2002 22:22:38 -  1.25
  +++ TagLibraryInfoImpl.java   27 Nov 2002 16:00:14 -  1.26
  @@ -407,6 +407,11 @@
* Parses the tag file directives of the given TagFile and turns them into
* a TagInfo.
*
  + * @param elem The  element in the TLD
  + * @param uri The location of the TLD, in case the tag file is specified
  + * relative to it
  + * @param jarFile The JAR file, in case the tag file is packaged in a JAR
  + *
* @return TagInfo correspoding to tag file directives
*/
   private TagFileInfo createTagFileInfo(TreeNode elem, String uri,
  
  
  

--
To unsubscribe, e-mail:   
For additional commands, e-mail: 




cvs commit: jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/compiler TagLibraryInfoImpl.java

2002-11-14 Thread luehe
luehe   2002/11/14 14:22:38

  Modified:jasper2/src/share/org/apache/jasper/compiler
TagLibraryInfoImpl.java
  Log:
  Fixed 4779016 (bugtraq): Translation error doesn't occur if there are
  two functions with the same name.
  
  Revision  ChangesPath
  1.25  +21 -10
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.24
  retrieving revision 1.25
  diff -u -r1.24 -r1.25
  --- TagLibraryInfoImpl.java   13 Nov 2002 18:38:11 -  1.24
  +++ TagLibraryInfoImpl.java   14 Nov 2002 22:22:38 -  1.25
  @@ -244,8 +244,8 @@
   {
   Vector tagVector = new Vector();
   Vector tagFileVector = new Vector();
  -Vector functionVector = new Vector();
  -
  +Hashtable functionTable = new Hashtable();
  + 
   // Create an iterator over the child elements of our  element
   ParserUtils pu = new ParserUtils();
   TreeNode tld = pu.parseXMLDocument(uri, in);
  @@ -278,9 +278,16 @@
   else if ("tag-file".equals(tname))
   tagFileVector.addElement(createTagFileInfo(element, uri,
   jarFile));
  -else if ("function".equals(tname))  // JSP2.0
  -functionVector.addElement(createFunctionInfo(element));
  -else if ("display-name".equals(tname) ||// Ignored elements
  +else if ("function".equals(tname)) { // JSP2.0
  + FunctionInfo funcInfo = createFunctionInfo(element);
  + String funcName = funcInfo.getName();
  + if (functionTable.containsKey(funcName)) {
  + err.jspError("jsp.error.tld.fn.duplicate.name",
  +  funcName, uri);
  +
  + }
  +functionTable.put(funcName, funcInfo);
  +} else if ("display-name".equals(tname) ||// Ignored elements
"small-icon".equals(tname) ||
"large-icon".equals(tname) ||
"listener".equals(tname)) {
  @@ -302,8 +309,12 @@
   this.tagFiles = new TagFileInfo[tagFileVector.size()];
   tagFileVector.copyInto (this.tagFiles);
   
  -this.functions = new FunctionInfo[functionVector.size()];
  -functionVector.copyInto (this.functions);
  +this.functions = new FunctionInfo[functionTable.size()];
  + int i=0;
  +Enumeration enum = functionTable.elements();
  + while (enum.hasMoreElements()) {
  + this.functions[i++] = (FunctionInfo) enum.nextElement();
  + }
   }
   
   private TagInfo createTagInfo(TreeNode elem) throws JasperException {
  
  
  

--
To unsubscribe, e-mail:   
For additional commands, e-mail: 




cvs commit: jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/compiler TagLibraryInfoImpl.java

2002-11-13 Thread kinman
kinman  2002/11/13 10:38:11

  Modified:jasper2/src/share/org/apache/jasper/compiler
TagLibraryInfoImpl.java
  Log:
  - Remove unused fields and methods.
  
  Revision  ChangesPath
  1.24  +3 -14 
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.23
  retrieving revision 1.24
  diff -u -r1.23 -r1.24
  --- TagLibraryInfoImpl.java   30 Oct 2002 17:41:22 -  1.23
  +++ TagLibraryInfoImpl.java   13 Nov 2002 18:38:11 -  1.24
  @@ -82,9 +82,6 @@
*/
   class TagLibraryInfoImpl extends TagLibraryInfo {
   
  -private static final String TAGLIB_TLD = "META-INF/taglib.tld";
  -private static final String WEB_XML = "/WEB-INF/web.xml";
  -
   private Hashtable jarEntries;
   private JspCompilationContext ctxt;
   private ErrorDispatcher err;
  @@ -241,14 +238,6 @@
}
   }
   
  -/*
  - * Returns true if the given URI is relative in this web application,
  - * false if it is an internet URI.
  - */
  -private boolean isRelativeURI(String uri) {
  -return (uri.indexOf(':') == -1);
  -}
  -  
   private void parseTLD(JspCompilationContext ctxt,
 String uri, InputStream in, JarFile jarFile) 
   throws JasperException
  
  
  

--
To unsubscribe, e-mail:   
For additional commands, e-mail: 




cvs commit: jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/compiler TagLibraryInfoImpl.java

2002-10-16 Thread luehe

luehe   2002/10/16 10:19:19

  Modified:jasper2/src/share/org/apache/jasper/compiler
TagLibraryInfoImpl.java
  Log:
  Fixed Bugtraq 4763825: TagAttributeInfo.getTypeName returns null for a
  static attribute.
  
  Revision  ChangesPath
  1.18  +10 -4 
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.17
  retrieving revision 1.18
  diff -u -r1.17 -r1.18
  --- TagLibraryInfoImpl.java   12 Oct 2002 18:55:29 -  1.17
  +++ TagLibraryInfoImpl.java   16 Oct 2002 17:19:19 -  1.18
  @@ -466,9 +466,9 @@
   
   TagAttributeInfo createAttribute(TreeNode elem) {
   String name = null;
  +String type = null;
   boolean required = false, rtexprvalue = false, reqTime = false,
isFragment = false;
  -String type = null;
   
   Iterator list = elem.findChildren();
   while (list.hasNext()) {
  @@ -502,6 +502,12 @@
   }
   }
   
  + if (!rtexprvalue) {
  + // According to JSP spec, for static values (those determined at
  + // translation time) the type is fixed at java.lang.String.
  + type = "java.lang.String";
  + }
  +
   return new TagAttributeInfo(name, required, type, rtexprvalue,
isFragment);
   }
  
  
  

--
To unsubscribe, e-mail:   
For additional commands, e-mail: 




cvs commit: jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/compiler TagLibraryInfoImpl.java

2002-08-25 Thread kinman

kinman  2002/08/25 16:13:18

  Modified:jasper2/src/share/org/apache/jasper/compiler
TagLibraryInfoImpl.java
  Log:
  - Recognize but ignore  and  elements
in TLD.
  
  Revision  ChangesPath
  1.13  +9 -5  
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.12
  retrieving revision 1.13
  diff -u -r1.12 -r1.13
  --- TagLibraryInfoImpl.java   20 Aug 2002 23:35:30 -  1.12
  +++ TagLibraryInfoImpl.java   25 Aug 2002 23:13:18 -  1.13
  @@ -293,9 +293,11 @@
   else if ("display-name".equals(tname) ||// Ignored elements
"small-icon".equals(tname) ||
"large-icon".equals(tname) ||
  - "listener".equals(tname))
  + "listener".equals(tname)) {
   ;
  -else {
  + } else if ("taglib-extension".equals(tname)) {
  + // Recognized but ignored
  +} else {
   Constants.message("jsp.warning.unknown.element.in.TLD", 
 new Object[] {tname},
 Logger.WARNING
  @@ -360,6 +362,8 @@
   dynamicAttributes = JspUtil.booleanValue(element.getBody());
   } else if ("example".equals(tname)) {
   // Ignored elements
  + } else if ("tag-extension".equals(tname)) {
  + // Ignored
   } else {
   Constants.message("jsp.warning.unknown.element.in.tag", 
 new Object[] {tname},
  
  
  

--
To unsubscribe, e-mail:   
For additional commands, e-mail: 




cvs commit: jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/compiler TagLibraryInfoImpl.java

2002-08-01 Thread kinman

kinman  2002/08/01 18:19:26

  Modified:jasper2/src/share/org/apache/jasper/compiler
TagLibraryInfoImpl.java
  Log:
  - Allows paths relative to TLD for tag files
  
  Revision  ChangesPath
  1.10  +10 -5 
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.9
  retrieving revision 1.10
  diff -u -r1.9 -r1.10
  --- TagLibraryInfoImpl.java   1 Aug 2002 21:17:58 -   1.9
  +++ TagLibraryInfoImpl.java   2 Aug 2002 01:19:26 -   1.10
  @@ -286,7 +286,7 @@
   else if ("tag".equals(tname))
   tagVector.addElement(createTagInfo(element));
   else if ("tag-file".equals(tname))
  -tagFileVector.addElement(createTagFileInfo(element));
  +tagFileVector.addElement(createTagFileInfo(element, uri));
   else if ("function".equals(tname))  // JSP2.0
   functionVector.addElement(createFunctionInfo(element));
   else if ("display-name".equals(tname) ||// Ignored elements
  @@ -438,7 +438,7 @@
*
* @return TagInfo correspoding to tag file directives
*/
  -private TagFileInfo createTagFileInfo(TreeNode elem)
  +private TagFileInfo createTagFileInfo(TreeNode elem, String uri)
throws JasperException {
   
String name = null;
  @@ -460,6 +460,11 @@
   }
}
   
  +path = path.replace('\\', '/');
  + if (!path.startsWith("/")) {
  + // relative to uri of TLD file
  +path = uri.substring(0, uri.lastIndexOf("/") + 1) + path;
  + }
TagInfo tagInfo = TagFileProcessor.parseTagFile(parserController,
name, path,
this);
  
  
  

--
To unsubscribe, e-mail:   
For additional commands, e-mail: