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

2004-06-25 Thread luehe
luehe   2004/06/25 12:05:05

  Modified:jasper2/src/share/org/apache/jasper/compiler Validator.java
  Log:
  Reverted fix for Bugzilla 29763 (The encoding of jsp document).
  
  We're supposed to throw an error only if there is an encoding declaration in the XML 
prolog that does not match the page encoding from the page directive or jsp-config. We 
must not throw any error if there is no XML prolog or encoding declaration in the 
prolog.
  
  The motivation for this is to make sure that JSP 1.2 pages with a page directive 
specifying a page encoding other than the default will continue to work in JSP 2.0 in 
most cases.
  
  The code is currently going through lots of pains to determine whether the encoding 
was specified in the XML prolog, or autodetected, to decide whether an error should be 
thrown.
  
  Revision  ChangesPath
  1.119 +4 -2  
jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/compiler/Validator.java
  
  Index: Validator.java
  ===
  RCS file: 
/home/cvs/jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/compiler/Validator.java,v
  retrieving revision 1.118
  retrieving revision 1.119
  diff -u -r1.118 -r1.119
  --- Validator.java24 Jun 2004 19:04:41 -  1.118
  +++ Validator.java25 Jun 2004 19:05:05 -  1.119
  @@ -285,10 +285,12 @@
   
   /*
* Compare the 'pageEncoding' attribute of the page directive with
  - * the encoding specified in the XML prolog (only for XML syntax!).
  + * the encoding specified in the XML prolog (only for XML syntax,
  + * and only if JSP document contains XML prolog with encoding
  + * declaration).
* Treat UTF-16, UTF-16BE, and UTF-16LE as identical.
*/
  - if (root.isXmlSyntax()) {
  + if (root.isXmlSyntax()  root.isEncodingSpecifiedInProlog()) {
String pageEnc = root.getPageEncoding();
   if (!pageDirEnc.equals(pageEnc) 
(!pageDirEnc.startsWith(UTF-16)
  
  
  

-
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 Validator.java

2004-06-24 Thread luehe
luehe   2004/06/24 12:04:41

  Modified:jasper2/src/share/org/apache/jasper/compiler Validator.java
  Log:
  Fixed Bugzilla 29763 (The encoding of jsp document)
  
  Revision  ChangesPath
  1.118 +47 -35
jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/compiler/Validator.java
  
  Index: Validator.java
  ===
  RCS file: 
/home/cvs/jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/compiler/Validator.java,v
  retrieving revision 1.117
  retrieving revision 1.118
  diff -u -r1.117 -r1.118
  --- Validator.java12 May 2004 01:14:59 -  1.117
  +++ Validator.java24 Jun 2004 19:04:41 -  1.118
  @@ -188,10 +188,6 @@
err.jspError(n, jsp.error.page.multi.pageencoding);
// 'pageEncoding' can occur at most once per file
pageEncodingSeen = true;
  - /*
  -  * Report any encoding conflict, treating UTF-16,
  -  * UTF-16BE, and UTF-16LE as identical.
  -  */
comparePageEncodings(value, n);
}
}
  @@ -256,37 +252,53 @@
// from the tag file in which the directive appeared
}
   
  - /*
  -  * Compares the page encoding specified in the 'pageEncoding'
  -  * attribute of the page directive with the encoding explicitly
  -  * specified in the XML prolog (only for XML syntax) and the encoding
  -  * specified in the JSP config element whose URL pattern matches the
  -  * page, and throws an error in case of a mismatch.
  -  */
  - private void comparePageEncodings(String pageDirEnc,
  -   Node.PageDirective n)
  - throws JasperException {
  -
  - String configEnc = n.getRoot().getJspConfigPageEncoding();
  -
  - if (configEnc != null  !pageDirEnc.equals(configEnc) 
  -  (!pageDirEnc.startsWith(UTF-16)
  - || !configEnc.startsWith(UTF-16))) {
  - err.jspError(n, jsp.error.config_pagedir_encoding_mismatch,
  -  configEnc, pageDirEnc);
  - }
  -
  - if (n.getRoot().isXmlSyntax()
  -  n.getRoot().isEncodingSpecifiedInProlog()) {
  - String pageEnc = n.getRoot().getPageEncoding();
  - if (!pageDirEnc.equals(pageEnc) 
  -  (!pageDirEnc.startsWith(UTF-16)
  - || !pageEnc.startsWith(UTF-16))) {
  - err.jspError(n, jsp.error.prolog_pagedir_encoding_mismatch,
  -  pageEnc, pageDirEnc);
  - }
  - }
  - }
  +/*
  + * Compares page encodings specified in various places, and throws
  + * exception in case of page encoding mismatch.
  + *
  + * @param pageDirEnc The value of the pageEncoding attribute of the
  + * page directive
  + * @param pageDir The page directive node
  + *
  + * @throws JasperException in case of page encoding mismatch
  + */
  +private void comparePageEncodings(String pageDirEnc,
  +  Node.PageDirective pageDir)
  +throws JasperException {
  +
  +Node.Root root = pageDir.getRoot();
  +String configEnc = root.getJspConfigPageEncoding();
  +
  +/*
  + * Compare the 'pageEncoding' attribute of the page directive with
  + * the encoding specified in the JSP config element whose URL
  + * pattern matches this page.
  + * Treat UTF-16, UTF-16BE, and UTF-16LE as identical.
  + */
  +if (configEnc != null  !pageDirEnc.equals(configEnc) 
  + (!pageDirEnc.startsWith(UTF-16)
  +|| !configEnc.startsWith(UTF-16))) {
  +err.jspError(pageDir,
  + jsp.error.config_pagedir_encoding_mismatch,
  + configEnc, pageDirEnc);
  +}
  +
  +/*
  + * Compare the 'pageEncoding' attribute of the page directive with
  + * the encoding specified in the XML prolog (only for XML syntax!).
  + * Treat UTF-16, UTF-16BE, and UTF-16LE as identical.
  + */
  + if (root.isXmlSyntax()) {
  + String pageEnc = root.getPageEncoding();
  +if (!pageDirEnc.equals(pageEnc) 
  + (!pageDirEnc.startsWith(UTF-16)
  +|| !pageEnc.startsWith(UTF-16))) {
  +err.jspError(pageDir,
  + jsp.error.prolog_pagedir_encoding_mismatch,
  + pageEnc, pageDirEnc);
  +}
  +}
  +}
   }
   
   /**
  

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

2004-02-03 Thread remm
remm2004/02/03 04:16:59

  Modified:jasper2/src/share/org/apache/jasper/compiler Validator.java
  Log:
  - Don't add blank parameters (bug 26628).
  
  Revision  ChangesPath
  1.115 +7 -4  
jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/compiler/Validator.java
  
  Index: Validator.java
  ===
  RCS file: 
/home/cvs/jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/compiler/Validator.java,v
  retrieving revision 1.114
  retrieving revision 1.115
  diff -u -r1.114 -r1.115
  --- Validator.java2 Sep 2003 21:39:58 -   1.114
  +++ Validator.java3 Feb 2004 12:16:59 -   1.115
  @@ -1346,7 +1346,10 @@
}
lastArg = true;
}
  - params.add(signature.substring(start, p).trim());
  +String arg = signature.substring(start, p).trim();
  +if (!.equals(arg)) {
  +params.add(arg);
  +}
if (lastArg) {
break;
}
  
  
  

-
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 Validator.java

2003-03-27 Thread luehe
luehe   2003/03/27 14:51:45

  Modified:jasper2/src/share/org/apache/jasper/resources
messages.properties
   jasper2/src/share/org/apache/jasper/compiler Validator.java
  Log:
  Replaced jsp.error.noMethod, which was not defined in properties file, with 
jsp.error.noFunctionMethod
  
  Revision  ChangesPath
  1.110 +3 -3  
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.109
  retrieving revision 1.110
  diff -u -r1.109 -r1.110
  --- messages.properties   25 Mar 2003 00:18:25 -  1.109
  +++ messages.properties   27 Mar 2003 22:51:45 -  1.110
  @@ -373,7 +373,7 @@
   jsp.error.jsproot.version.invalid=Invalid version number: \{0}\, must be \1.2\ 
or \2.0\
   jsp.error.noFunctionPrefix=The function {0} must be used with a prefix when a 
default namespace is not specified
   jsp.error.noFunction=The function {0} cannot be located with the specified prefix
  -jsp.error.noFunctionMethod=The method {0} for the function {1} is not defined in 
the class {2}
  -jsp.error.function.classnotfound=The class {0} specified in TLD for the function 
{1} cannot be found. {2}
  +jsp.error.noFunctionMethod=Method \{0}\ for function \{1}\ not found in class 
\{2}\
  +jsp.error.function.classnotfound=The class {0} specified in TLD for the function 
{1} cannot be found: {2}
   jsp.error.signature.classnotfound=The class {0} specified in the method signature 
in TLD for the function {1} cannot be found. {2}
   
  
  
  
  1.99  +20 -18
jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/compiler/Validator.java
  
  Index: Validator.java
  ===
  RCS file: 
/home/cvs/jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/compiler/Validator.java,v
  retrieving revision 1.98
  retrieving revision 1.99
  diff -u -r1.98 -r1.99
  --- Validator.java25 Mar 2003 01:49:29 -  1.98
  +++ Validator.java27 Mar 2003 22:51:45 -  1.99
  @@ -1238,8 +1238,7 @@
jsp.error.attribute.invalidPrefix, prefix);
}
}
  - TagLibraryInfo taglib = 
  - (TagLibraryInfo) taglibs.get(uri);
  + TagLibraryInfo taglib = (TagLibraryInfo) taglibs.get(uri);
FunctionInfo funcInfo = null;
if (taglib != null) {
funcInfo = taglib.getFunction(function);
  @@ -1274,12 +1273,12 @@
int start = signature.indexOf(' ');
if (start  0) {
err.jspError(jsp.error.tld.fn.invalid.signature,
  - func.getPrefix(), func.getName());
  +  func.getPrefix(), func.getName());
}
int end = signature.indexOf('(');
if (end  0) {
err.jspError(jsp.error.tld.fn.invalid.signature.parenexpected,
  - func.getPrefix(), func.getName());
  +  func.getPrefix(), func.getName());
}
return signature.substring(start+1, end).trim();
}
  @@ -1304,7 +1303,7 @@
p = signature.indexOf(')', start);
if (p  0) {
err.jspError(jsp.error.tld.fn.invalid.signature,
  - func.getPrefix(), func.getName());
  +  func.getPrefix(), func.getName());
}
lastArg = true;
}
  @@ -1327,7 +1326,8 @@
fnmap.put(fnQName, method);
}
   
  - public Method resolveFunction(String prefix, String localName) {
  + public Method resolveFunction(String prefix,
  +   String localName) {
return (Method) this.fnmap.get(prefix + : + localName);
}
}
  @@ -1348,9 +1348,9 @@
n.getFunctionInfo().getFunctionClass());
} catch (ClassNotFoundException e) {
err.jspError(jsp.error.function.classnotfound,
  - n.getFunctionInfo().getFunctionClass(),
  - n.getPrefix() + ':' + n.getName(),
  - e.getMessage());
  +  n.getFunctionInfo().getFunctionClass(),
  +  n.getPrefix() + ':' + n.getName(),
  +  e.getMessage());
}
String paramTypes[] = n.getParameters();
int size = 

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

2003-03-04 Thread luehe
luehe   2003/03/04 14:34:26

  Modified:jasper2/src/share/org/apache/jasper/compiler Validator.java
  Log:
  Fixed regression when checking that no invalid named attributes are present
  
  Revision  ChangesPath
  1.89  +4 -4  
jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/compiler/Validator.java
  
  Index: Validator.java
  ===
  RCS file: 
/home/cvs/jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/compiler/Validator.java,v
  retrieving revision 1.88
  retrieving revision 1.89
  diff -u -r1.88 -r1.89
  --- Validator.java3 Mar 2003 18:19:59 -   1.88
  +++ Validator.java4 Mar 2003 22:34:25 -   1.89
  @@ -998,7 +998,7 @@
String attrPrefix = na.getPrefix();
if (na.getLocalName().equals(tldAttrs[j].getName())
 (attrPrefix == null || attrPrefix.length() == 0
  - || attrPrefix == n.getPrefix())) {
  + || attrPrefix.equals(n.getPrefix( {
jspAttrs[start + i] = new Node.JspAttribute(na, false);
NamedAttributeVisitor nav = null;
if (na.getBody() != 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 Validator.java

2003-03-04 Thread luehe
luehe   2003/03/04 14:41:13

  Modified:jasper2/src/share/org/apache/jasper/compiler Validator.java
  Log:
  Fixed URI comparison when checking that no invalid XML-style attributes are present
  
  Revision  ChangesPath
  1.90  +4 -4  
jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/compiler/Validator.java
  
  Index: Validator.java
  ===
  RCS file: 
/home/cvs/jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/compiler/Validator.java,v
  retrieving revision 1.89
  retrieving revision 1.90
  diff -u -r1.89 -r1.90
  --- Validator.java4 Mar 2003 22:34:25 -   1.89
  +++ Validator.java4 Mar 2003 22:41:12 -   1.90
  @@ -891,7 +891,7 @@
if (attrs.getLocalName(i).equals(tldAttrs[j].getName())
 (attrs.getURI(i) == null
|| attrs.getURI(i).length() == 0
  - || attrs.getURI(i) == n.getURI())) {
  + || attrs.getURI(i).equals(n.getURI( {
if (tldAttrs[j].canBeRequestTime()) {
   Class expectedType = String.class;
   try {
  
  
  

-
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 Validator.java

2003-02-26 Thread luehe
luehe   2003/02/26 08:51:07

  Modified:jasper2/src/share/org/apache/jasper/compiler Validator.java
  Log:
  Fixed 17397: Jasper incorrectly generates a translation error if the
  omit-xml-declaration attribute of the jsp:output action is not
  specified.
  
  Revision  ChangesPath
  1.83  +4 -4  
jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/compiler/Validator.java
  
  Index: Validator.java
  ===
  RCS file: 
/home/cvs/jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/compiler/Validator.java,v
  retrieving revision 1.82
  retrieving revision 1.83
  diff -u -r1.82 -r1.83
  --- Validator.java26 Feb 2003 01:57:30 -  1.82
  +++ Validator.java26 Feb 2003 16:51:07 -  1.83
  @@ -437,7 +437,7 @@
new JspUtil.ValidAttribute(scope) };
   
private static final JspUtil.ValidAttribute[] jspOutputAttrs = {
  - new JspUtil.ValidAttribute(omit-xml-declaration, true) };
  + new JspUtil.ValidAttribute(omit-xml-declaration) };
   
/*
 * Constructor
  
  
  

-
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 Validator.java

2003-02-25 Thread luehe
luehe   2003/02/25 17:32:20

  Modified:jasper2/src/share/org/apache/jasper/compiler Validator.java
  Log:
  Fixed 17403
  
  Revision  ChangesPath
  1.81  +27 -16
jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/compiler/Validator.java
  
  Index: Validator.java
  ===
  RCS file: 
/home/cvs/jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/compiler/Validator.java,v
  retrieving revision 1.80
  retrieving revision 1.81
  diff -u -r1.80 -r1.81
  --- Validator.java26 Feb 2003 00:11:38 -  1.80
  +++ Validator.java26 Feb 2003 01:32:20 -  1.81
  @@ -895,13 +895,21 @@
public void visit(Node.JspElement n) throws JasperException {
   
Attributes attrs = n.getAttributes();
  -Node.Nodes namedAttrs = n.getNamedAttributeNodes();
int xmlAttrLen = attrs.getLength();
  - Node.JspAttribute[] jspAttrs = new Node.JspAttribute[xmlAttrLen-1
  - + namedAttrs.size()];
  + if (xmlAttrLen == 0) {
  + err.jspError(n, jsp.error.jspelement.missing.name);
  + }
  +Node.Nodes namedAttrs = n.getNamedAttributeNodes();
  +
  + // XML-style 'name' attribute, which is mandatory, must not be
  + // included in JspAttribute array
  + int jspAttrSize = xmlAttrLen-1 + namedAttrs.size();
  +
  + Node.JspAttribute[] jspAttrs = new Node.JspAttribute[jspAttrSize];
  + int jspAttrIndex = 0;
   
// Process XML-style attributes
  - for (int i=0; ixmlAttrLen  ijspAttrs.length; i++) {
  + for (int i=0; ixmlAttrLen; i++) {
if (name.equals(attrs.getLocalName(i))) {
n.setNameAttribute(getJspAttribute(attrs.getQName(i),
   attrs.getURI(i),
  @@ -912,14 +920,17 @@
   n,
   false));
} else {
  - jspAttrs[i] = getJspAttribute(attrs.getQName(i),
  -   attrs.getURI(i),
  -   attrs.getLocalName(i),
  -   attrs.getValue(i),
  -   java.lang.Object.class,
  -   null,
  -   n,
  -   false);
  + if (jspAttrIndexjspAttrSize) {
  + jspAttrs[jspAttrIndex++]
  + = getJspAttribute(attrs.getQName(i),
  +   attrs.getURI(i),
  +   attrs.getLocalName(i),
  +   attrs.getValue(i),
  +   java.lang.Object.class,
  +   null,
  +   n,
  +   false);
  + }
}
}
if (n.getNameAttribute() == null) {
  @@ -929,7 +940,7 @@
// Process named attributes
for (int i=0; inamedAttrs.size(); i++) {
   Node.NamedAttribute na = (Node.NamedAttribute) 
namedAttrs.getNode(i);
  - jspAttrs[xmlAttrLen-1 + i] = new Node.JspAttribute(na, false);
  + jspAttrs[jspAttrIndex++] = new Node.JspAttribute(na, false);
}
   
n.setJspAttributes(jspAttrs);
  
  
  

-
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 Validator.java

2003-02-13 Thread luehe
luehe   2003/02/13 14:48:45

  Modified:jasper2/src/share/org/apache/jasper/compiler Validator.java
  Log:
  Fixed 17062: Unable to specify the 'var' or 'varReader' attributes of
  jsp:invoke using the jsp:attribute action.
  
  Revision  ChangesPath
  1.76  +7 -7  
jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/compiler/Validator.java
  
  Index: Validator.java
  ===
  RCS file: 
/home/cvs/jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/compiler/Validator.java,v
  retrieving revision 1.75
  retrieving revision 1.76
  diff -u -r1.75 -r1.76
  --- Validator.java12 Feb 2003 23:44:23 -  1.75
  +++ Validator.java13 Feb 2003 22:48:44 -  1.76
  @@ -953,8 +953,8 @@
String scope = n.getTextAttribute (scope);
JspUtil.checkScope(scope, n, err);
   
  - String var = n.getAttributeValue(var);
  - String varReader = n.getAttributeValue(varReader);
  + String var = n.getTextAttribute(var);
  + String varReader = n.getTextAttribute(varReader);
if (scope != null  var == null  varReader == null) {
err.jspError(n, jsp.error.missing_var_or_varReader);
}
  @@ -970,8 +970,8 @@
String scope = n.getTextAttribute (scope);
JspUtil.checkScope(scope, n, err);
   
  - String var = n.getAttributeValue(var);
  - String varReader = n.getAttributeValue(varReader);
  + String var = n.getTextAttribute(var);
  + String varReader = n.getTextAttribute(varReader);
if (scope != null  var == null  varReader == null) {
err.jspError(n, jsp.error.missing_var_or_varReader);
}
  
  
  

-
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 Validator.java

2003-02-10 Thread luehe
luehe   2003/02/10 09:07:08

  Modified:jasper2/src/share/org/apache/jasper/compiler Validator.java
  Log:
  Fixed 16200 (isThreadSafe does not work !!)
  
  Revision  ChangesPath
  1.74  +4 -4  
jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/compiler/Validator.java
  
  Index: Validator.java
  ===
  RCS file: 
/home/cvs/jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/compiler/Validator.java,v
  retrieving revision 1.73
  retrieving revision 1.74
  diff -u -r1.73 -r1.74
  --- Validator.java8 Feb 2003 00:06:40 -   1.73
  +++ Validator.java10 Feb 2003 17:07:08 -  1.74
  @@ -208,7 +208,7 @@
pageInfo.setAutoFlush(false);
else
err.jspError(n, jsp.error.autoFlush.invalid);
  - } else if (isthreadSafe.equals(attr)) {
  + } else if (isThreadSafe.equals(attr)) {
if (isThreadSafeSeen)
err.jspError(n, jsp.error.page.multiple.threadsafe);
isThreadSafeSeen = true;
  
  
  

-
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 Validator.java

2003-01-14 Thread luehe
luehe   2003/01/14 15:14:58

  Modified:jasper2/src/share/org/apache/jasper/compiler Validator.java
  Log:
  Visit subnodes of UninterpretedTag during validation
  
  Revision  ChangesPath
  1.67  +5 -3  
jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/compiler/Validator.java
  
  Index: Validator.java
  ===
  RCS file: 
/home/cvs/jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/compiler/Validator.java,v
  retrieving revision 1.66
  retrieving revision 1.67
  diff -u -r1.66 -r1.67
  --- Validator.java14 Jan 2003 22:32:58 -  1.66
  +++ Validator.java14 Jan 2003 23:14:58 -  1.67
  @@ -660,6 +660,8 @@
   if (n.getNamedAttributeNodes().size() != 0) {
err.jspError(n, jsp.error.namedAttribute.invalidUse);
   }
  +
  + visitBody(n);
   }
   
public void visit(Node.CustomTag n) throws JasperException {
  
  
  

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




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

2002-12-13 Thread luehe
luehe   2002/12/13 07:34:40

  Modified:jasper2/src/share/org/apache/jasper/compiler Validator.java
  Log:
  Fixed 15354: Jasper doesn't cause a translation error if an EL or RT
  expression is provided to an attribute of jsp:plugin that doesn't
  accept dynamic attribute values.
  
  Revision  ChangesPath
  1.58  +46 -23
jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/compiler/Validator.java
  
  Index: Validator.java
  ===
  RCS file: 
/home/cvs/jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/compiler/Validator.java,v
  retrieving revision 1.57
  retrieving revision 1.58
  diff -u -r1.57 -r1.58
  --- Validator.java9 Dec 2002 23:27:03 -   1.57
  +++ Validator.java13 Dec 2002 15:34:39 -  1.58
  @@ -478,11 +478,7 @@
   paramActionAttrs, err);
// make sure the value of the 'name' attribute is not a
// request-time expression
  - if (isExpression(n, n.getAttributes().getValue(name))) {
  - err.jspError(n,
  -  jsp.error.attribute.standard.non_rt_with_expr,
  -  name, jsp:param);
  - }
  + throwErrorIfExpression(n, name, jsp:param);
n.setValue(getJspAttribute(value, null, null,
   n.getAttributeValue(value),
  java.lang.String.class, null,
  @@ -575,6 +571,18 @@
public void visit(Node.PlugIn n) throws JasperException {
   JspUtil.checkAttributes(Plugin, n, plugInAttrs, err);
   
  + throwErrorIfExpression(n, type, jsp:plugin);
  + throwErrorIfExpression(n, code, jsp:plugin);
  + throwErrorIfExpression(n, codebase, jsp:plugin);
  + throwErrorIfExpression(n, align, jsp:plugin);
  + throwErrorIfExpression(n, archive, jsp:plugin);
  + throwErrorIfExpression(n, hspace, jsp:plugin);
  + throwErrorIfExpression(n, jreversion, jsp:plugin);
  + throwErrorIfExpression(n, name, jsp:plugin);
  + throwErrorIfExpression(n, vspace, jsp:plugin);
  + throwErrorIfExpression(n, nspluginurl, jsp:plugin);
  + throwErrorIfExpression(n, iepluginurl, jsp:plugin);
  +
String type = n.getTextAttribute(type);
if (type == null)
err.jspError(n, jsp.error.plugin.notype);
  @@ -891,6 +899,24 @@
n.getAttributeValue(omit-xml-declaration));
}
   
  + public void visit(Node.InvokeAction n) throws JasperException {
  +
  +JspUtil.checkAttributes(Invoke, n, invokeAttrs, err);
  + if (n.getAttributeValue(var) != null
  +  n.getAttributeValue(varReader) != null) {
  + err.jspError(n, jsp.error.invoke.varAndVarReader);
  + }
  + }
  +
  + public void visit(Node.DoBodyAction n) throws JasperException {
  +
  +JspUtil.checkAttributes(DoBody, n, doBodyAttrs, err);
  + if (n.getAttributeValue(var) != null
  +  n.getAttributeValue(varReader) != null) {
  + err.jspError(n, jsp.error.doBody.varAndVarReader);
  + }
  + }
  +
/**
 * Preprocess attributes that can be expressions.  Expression
 * delimiters are stripped.
  @@ -992,21 +1018,18 @@
return false;
}
   
  - public void visit(Node.InvokeAction n) throws JasperException {
  -
  -JspUtil.checkAttributes(Invoke, n, invokeAttrs, err);
  - if (n.getAttributeValue(var) != null
  -  n.getAttributeValue(varReader) != null) {
  - err.jspError(n, jsp.error.invoke.varAndVarReader);
  - }
  - }
  -
  - public void visit(Node.DoBodyAction n) throws JasperException {
  -
  -JspUtil.checkAttributes(DoBody, n, doBodyAttrs, err);
  - if (n.getAttributeValue(var) != null
  -  n.getAttributeValue(varReader) != null) {
  - err.jspError(n, jsp.error.doBody.varAndVarReader);
  + /*
  +  * Throws exception if the value of the attribute with the given
  +  * name in the given node is given as an RT or EL expression, but the
  +  * spec requires a static value.
  +  */
  + private void throwErrorIfExpression(Node n, String attrName,
  + String actionName)
  + throws JasperException {
  + if (isExpression(n, n.getAttributes().getValue(attrName))) {
  + err.jspError(n,
  +  jsp.error.attribute.standard.non_rt_with_expr,
  +  attrName, actionName);
}
}
   }
  
  
  

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




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

2002-12-13 Thread luehe
luehe   2002/12/13 07:55:34

  Modified:jasper2/src/share/org/apache/jasper/compiler Validator.java
  Log:
  Fixed 15354 (Cont.): Jasper doesn't cause a translation error if an EL
  or RT expression is provided to an attribute of jsp:plugin that
  doesn't accept dynamic attribute values.
  
  Revision  ChangesPath
  1.59  +6 -4  
jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/compiler/Validator.java
  
  Index: Validator.java
  ===
  RCS file: 
/home/cvs/jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/compiler/Validator.java,v
  retrieving revision 1.58
  retrieving revision 1.59
  diff -u -r1.58 -r1.59
  --- Validator.java13 Dec 2002 15:34:39 -  1.58
  +++ Validator.java13 Dec 2002 15:55:34 -  1.59
  @@ -1026,7 +1026,9 @@
private void throwErrorIfExpression(Node n, String attrName,
String actionName)
throws JasperException {
  - if (isExpression(n, n.getAttributes().getValue(attrName))) {
  + if (n.getAttributes() != null
  +  n.getAttributes().getValue(attrName) != null
  +  isExpression(n, n.getAttributes().getValue(attrName))) {
err.jspError(n,
 jsp.error.attribute.standard.non_rt_with_expr,
 attrName, actionName);
  
  
  

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




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

2002-12-09 Thread luehe
luehe   2002/12/09 14:26:10

  Modified:jasper2/src/share/org/apache/jasper/compiler Validator.java
  Log:
  When verifying that a custom action does not have any invalid
  attributes, take the attributes' URI into account.
  
  Revision  ChangesPath
  1.56  +28 -4 
jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/compiler/Validator.java
  
  Index: Validator.java
  ===
  RCS file: 
/home/cvs/jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/compiler/Validator.java,v
  retrieving revision 1.55
  retrieving revision 1.56
  diff -u -r1.55 -r1.56
  --- Validator.java8 Nov 2002 19:55:47 -   1.55
  +++ Validator.java9 Dec 2002 22:26:10 -   1.56
  @@ -361,6 +361,7 @@
private ErrorDispatcher err;
private TagInfo tagInfo;
   private ClassLoader loader;
  + private Hashtable taglibs;
   
// A FunctionMapper, used to validate EL expressions.
   private FunctionMapper functionMapper;
  @@ -442,6 +443,7 @@
 */
ValidateVisitor(Compiler compiler) {
this.pageInfo = compiler.getPageInfo();
  + this.taglibs = pageInfo.getTagLibraries();
this.err = compiler.getErrorDispatcher();
this.tagInfo = compiler.getCompilationContext().getTagInfo();
this.loader = compiler.getCompilationContext().getClassLoader();
  @@ -679,10 +681,32 @@
= new Node.JspAttribute[attrs.getLength()
   + namedAttributeNodes.size()];
Hashtable tagDataAttrs = new Hashtable(attrs.getLength());
  + TagLibraryInfo tagLibInfo =
  + (TagLibraryInfo) taglibs.get(n.getPrefix());
  + String uri = tagLibInfo.getURI();
for (int i=0; iattrs.getLength(); i++) {
boolean found = false;
for (int j=0; tldAttrs != null  jtldAttrs.length; j++) {
  - if (attrs.getQName(i).equals(tldAttrs[j].getName())) {
  + /*
  +  * A custom action and its declared attributes always
  +  * belong to the same namespace, which is identified by
  +  * the prefix name of the custom tag invocation.
  +  * For example, in this invocation:
  +  * my:test a=1 b=2 c=3/, the action
  +  * test and its attributes a, b, and c all belong
  +  * to the namespace identified by the prefix my.
  +  * The above invocation would be equivalent to:
  +  * my:test my:a=1 my:b=2 my:c=3/
  +  * An action attribute may have a prefix different from
  +  * that of the action invocation only if the underlying
  +  * tag handler supports dynamic attributes, in which case
  +  * the attribute with the different prefix is considered a
  +  * dynamic attribute.
  +  */
  + if (attrs.getLocalName(i).equals(tldAttrs[j].getName())
  +  (attrs.getURI(i) == null
  + || attrs.getURI(i).length() == 0
  + || attrs.getURI(i) == uri)) {
if (tldAttrs[j].canBeRequestTime()) {
   Class expectedType = String.class;
   try {
  
  
  

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




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

2002-11-07 Thread luehe
luehe   2002/11/07 16:55:46

  Modified:jasper2/src/share/org/apache/jasper/compiler Validator.java
  Log:
  Made enumeration of ValidationMessage[] returned by TLV's validate()
  method more robust by also considering the case where a
  ValidationMessage element might be null.
  
  Revision  ChangesPath
  1.53  +10 -8 
jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/compiler/Validator.java
  
  Index: Validator.java
  ===
  RCS file: 
/home/cvs/jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/compiler/Validator.java,v
  retrieving revision 1.52
  retrieving revision 1.53
  diff -u -r1.52 -r1.53
  --- Validator.java7 Nov 2002 22:19:13 -   1.52
  +++ Validator.java8 Nov 2002 00:55:45 -   1.53
   -1117,11 +1117,13 
tli.getShortName()));
   errMsg.append(/h3);
   for (int i=0; ierrors.length; i++) {
  -errMsg.append(p);
  -errMsg.append(errors[i].getId());
  -errMsg.append(: );
  -errMsg.append(errors[i].getMessage());
  -errMsg.append(/p);
  + if (errors[i] != null) {
  + errMsg.append(p);
  + errMsg.append(errors[i].getId());
  + errMsg.append(: );
  + errMsg.append(errors[i].getMessage());
  + errMsg.append(/p);
  + }
   }
   }
   }
  
  
  

--
To unsubscribe, e-mail:   mailto:tomcat-dev-unsubscribe;jakarta.apache.org
For additional commands, e-mail: mailto:tomcat-dev-help;jakarta.apache.org




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

2002-10-13 Thread luehe

luehe   2002/10/12 12:09:14

  Modified:jasper2/src/share/org/apache/jasper/compiler Validator.java
  Log:
  Fixed 13553: Jasper incorrectly generating a translation error if a
  tag has both a TEI and variable declarations.
  
  Revision  ChangesPath
  1.42  +5 -4  
jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/compiler/Validator.java
  
  Index: Validator.java
  ===
  RCS file: 
/home/cvs/jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/compiler/Validator.java,v
  retrieving revision 1.41
  retrieving revision 1.42
  diff -u -r1.41 -r1.42
  --- Validator.java12 Oct 2002 18:55:29 -  1.41
  +++ Validator.java12 Oct 2002 19:09:14 -  1.42
  @@ -797,7 +797,8 @@
// class that returns a non-null object.
TagExtraInfo tei = tagInfo.getTagExtraInfo();
if (tei != null  tei.getVariableInfo(tagData) != null
  -  tagInfo.getTagVariableInfos() != null) {
  +  tagInfo.getTagVariableInfos() != null
  +  tagInfo.getTagVariableInfos().length  0) {
err.jspError(jsp.error.non_null_tei_and_var_subelems,
 n.getName());
}
  
  
  

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




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

2002-08-25 Thread kinman

kinman  2002/08/25 14:49:55

  Modified:jasper2/src/share/org/apache/jasper/compiler Validator.java
  Log:
  - Complete Mark Roth's patch.
  
  Revision  ChangesPath
  1.31  +43 -3 
jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/compiler/Validator.java
  
  Index: Validator.java
  ===
  RCS file: 
/home/cvs/jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/compiler/Validator.java,v
  retrieving revision 1.30
  retrieving revision 1.31
  diff -u -r1.30 -r1.31
  --- Validator.java24 Aug 2002 21:42:34 -  1.30
  +++ Validator.java25 Aug 2002 21:49:55 -  1.31
  @@ -275,6 +275,46 @@
   // tag file in which the directive appeared.
   
   // This method does additional processing to collect page info
  +
  + Attributes attrs = n.getAttributes();
  + for (int i = 0; i  attrs.getLength(); i++) {
  + String attr = attrs.getQName(i);
  + String value = attrs.getValue(i);
  +
  + if (language.equals(attr)) {
  + if (languageSeen)
  + err.jspError(n, jsp.error.page.multiple.language);
  + languageSeen = true;
  + if (!java.equalsIgnoreCase(value))
  + err.jspError(n, jsp.error.language.nonjava);
  + pageInfo.setLanguage(value);
  + } else if (isScriptingEnabled.equals(attr)) {
  + // XXX Test for multiple occurrence?
  + if (true.equalsIgnoreCase(value))
  + pageInfo.setScriptingEnabled(true);
  + else if (false.equalsIgnoreCase(value))
  + pageInfo.setScriptingEnabled(false);
  + else
  + err.jspError(n, jsp.error.isScriptingEnabled.invalid);
  + } else if (isELEnabled.equals(attr)) {
  + // XXX Test for multiple occurrence?
  + if (true.equalsIgnoreCase(value))
  + pageInfo.setELEnabled(true);
  + else if (false.equalsIgnoreCase(value))
  + pageInfo.setELEnabled(false);
  + else
  + err.jspError(n, jsp.error.isELEnabled.invalid);
  + } else if (pageEncoding.equals(attr)) {
  + if (pageEncodingSeen) 
  + err.jspError(n, jsp.error.page.multiple.pageencoding);
  + pageEncodingSeen = true;
  + pageInfo.setPageEncoding(value);
  + }
  + }
  +
  + // Attributes for imports for this node have been processed by
  + // the parsers, just add them to pageInfo.
  + pageInfo.addImports(n.getImports());
}
   
public void visit(Node.AttributeDirective n) throws JasperException {
  
  
  

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




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

2002-06-20 Thread kinman

kinman  2002/06/20 16:48:23

  Modified:jasper2/src/share/org/apache/jasper/compiler Validator.java
  Log:
  - Fixed 9996, and possibly 9993: set the default charset from the
pageEncoding if contentType specified does not include a charset.
  
  Revision  ChangesPath
  1.10  +12 -6 
jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/compiler/Validator.java
  
  Index: Validator.java
  ===
  RCS file: 
/home/cvs/jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/compiler/Validator.java,v
  retrieving revision 1.9
  retrieving revision 1.10
  diff -u -r1.9 -r1.10
  --- Validator.java5 Jun 2002 22:01:33 -   1.9
  +++ Validator.java20 Jun 2002 23:48:23 -  1.10
  @@ -583,13 +583,19 @@
// Determine the default output content type, per errata_a
// 
http://jcp.org/aboutJava/communityprocess/maintenance/jsr053/errata_1_2_a_20020321.html
PageInfo pageInfo = compiler.getPageInfo();
  - if (pageInfo.getContentType() == null) {
  + String contentType = pageInfo.getContentType();
  + if (contentType == null || contentType.indexOf(charset=)  0) {
boolean isXml = page.getRoot().isXmlSyntax();
  - String defaultType = isXml? text/xml;: text/html;;
  + String defaultType;
  + if (contentType == null) {
  + defaultType = isXml? text/xml: text/html;
  + } else {
  + defaultType = contentType;
  + }
String charset = pageInfo.getPageEncoding();
if (charset == null)
charset = isXml? UTF-8: ISO-8859-1;
  - pageInfo.setContentType(defaultType + charset);
  + pageInfo.setContentType(defaultType + ; + charset);
}
   
/*
  
  
  

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




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

2002-04-08 Thread kinman

kinman  02/04/08 14:47:30

  Modified:jasper2/src/share/org/apache/jasper/compiler Validator.java
  Log:
  - Make sure that visiBody is called for nodes that may have a body.
  
  Revision  ChangesPath
  1.2   +10 -3 
jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/compiler/Validator.java
  
  Index: Validator.java
  ===
  RCS file: 
/home/cvs/jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/compiler/Validator.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- Validator.java28 Mar 2002 18:46:17 -  1.1
  +++ Validator.java8 Apr 2002 21:47:30 -   1.2
  @@ -1,7 +1,7 @@
   /*
  - * $Header: 
/home/cvs/jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/compiler/Validator.java,v
 1.1 2002/03/28 18:46:17 kinman Exp $
  - * $Revision: 1.1 $
  - * $Date: 2002/03/28 18:46:17 $
  + * $Header: 
/home/cvs/jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/compiler/Validator.java,v
 1.2 2002/04/08 21:47:30 kinman Exp $
  + * $Revision: 1.2 $
  + * $Date: 2002/04/08 21:47:30 $
*
* 
* 
  @@ -310,6 +310,7 @@
public void visit(Node.IncludeDirective n) throws JasperException {
JspUtil.checkAttributes(Include directive, n.getAttributes(),
includeDirectiveAttrs, n.getStart(), err);
  + visitBody(n);
}
   
public void visit(Node.TaglibDirective n) throws JasperException {
  @@ -329,6 +330,7 @@
includeActionAttrs, n.getStart(), err);
n.setPage(getJspAttribute(page, n.getAttributeValue(page),
  n.isXmlSyntax()));
  + visitBody(n);
   };
   
public void visit(Node.ForwardAction n) throws JasperException {
  @@ -336,6 +338,7 @@
forwardActionAttrs, n.getStart(), err);
n.setPage(getJspAttribute(page, n.getAttributeValue(page),
  n.isXmlSyntax()));
  + visitBody(n);
}
   
public void visit(Node.GetProperty n) throws JasperException {
  @@ -400,6 +403,8 @@
beanInfo.addApplicationBean(name,className);
} else 
err.jspError(n, jsp.error.useBean.badScope);
  +
  + visitBody(n);
}
   
public void visit(Node.PlugIn n) throws JasperException {
  @@ -413,6 +418,8 @@
err.jspError(n, jsp.error.plugin.badtype);
if (n.getAttributeValue(code) == null)
err.jspError(n, jsp.error.plugin.nocode);
  +
  + visitBody(n);
}
   
public void visit(Node.CustomTag n) throws JasperException {
  
  
  

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