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

2005-03-09 Thread kinman
kinman  2005/03/09 11:13:20

  Modified:jasper2/src/share/org/apache/jasper/compiler Parser.java
  Log:
  - Fix a bug: if \${} appears at the beginning of a page, the escape is not
recognized.
  
  Revision  ChangesPath
  1.90  +5 -1  
jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/compiler/Parser.java
  
  Index: Parser.java
  ===
  RCS file: 
/home/cvs/jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/compiler/Parser.java,v
  retrieving revision 1.89
  retrieving revision 1.90
  diff -u -r1.89 -r1.90
  --- Parser.java   17 Mar 2004 19:23:03 -  1.89
  +++ Parser.java   9 Mar 2005 19:13:20 -   1.90
  @@ -1381,7 +1381,11 @@
CharArrayWriter ttext = new CharArrayWriter();
// Output the first character
int ch = reader.nextChar();
  - ttext.write(ch);
  +if (ch == '\\') {
  +reader.pushChar();
  +} else {
  +ttext.write(ch);
  +}
   
while (reader.hasMoreInput()) {
ch = reader.nextChar();
  
  
  

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

2005-02-08 Thread kinman
kinman  2005/02/08 10:03:58

  Modified:jasper2/src/share/org/apache/jasper/compiler Generator.java
  Log:
  - More fine-tuning on smap for jsp:element, making sure that the java
line range is at least one.
  
  Revision  ChangesPath
  1.239 +4 -3  
jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/compiler/Generator.java
  
  Index: Generator.java
  ===
  RCS file: 
/home/cvs/jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/compiler/Generator.java,v
  retrieving revision 1.238
  retrieving revision 1.239
  diff -u -r1.238 -r1.239
  --- Generator.java8 Feb 2005 00:23:58 -   1.238
  +++ Generator.java8 Feb 2005 18:03:58 -   1.239
  @@ -1825,9 +1825,6 @@
   out.print((String)map.get(attrName));
   }
   
  -// Smap should not include the body
  -n.setEndJavaLine(out.getJavaLine());
  -
   // Does the jsp:element have nested tags other than
   // jsp:attribute
   boolean hasBody = false;
  @@ -1844,6 +1841,9 @@
   if (hasBody) {
   out.println( + \\););
   
  +// Smap should not include the body
  +n.setEndJavaLine(out.getJavaLine());
  +
   // Visit tag body
   visitBody(n);
   
  @@ -1853,6 +1853,7 @@
   out.println( + \\););
   } else {
   out.println( + \/\););
  +n.setEndJavaLine(out.getJavaLine());
   }
   }
   
  
  
  

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

2005-02-07 Thread kinman
kinman  2005/02/07 16:23:58

  Modified:jasper2/src/share/org/apache/jasper/compiler Generator.java
  Log:
  - Samp for a jsp:element should not include its body.
  
  Revision  ChangesPath
  1.238 +3 -2  
jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/compiler/Generator.java
  
  Index: Generator.java
  ===
  RCS file: 
/home/cvs/jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/compiler/Generator.java,v
  retrieving revision 1.237
  retrieving revision 1.238
  diff -u -r1.237 -r1.238
  --- Generator.java9 Sep 2004 14:26:53 -   1.237
  +++ Generator.java8 Feb 2005 00:23:58 -   1.238
  @@ -1825,6 +1825,9 @@
   out.print((String)map.get(attrName));
   }
   
  +// Smap should not include the body
  +n.setEndJavaLine(out.getJavaLine());
  +
   // Does the jsp:element have nested tags other than
   // jsp:attribute
   boolean hasBody = false;
  @@ -1851,8 +1854,6 @@
   } else {
   out.println( + \/\););
   }
  -
  -n.setEndJavaLine(out.getJavaLine());
   }
   
   public void visit(Node.TemplateText n) throws JasperException {
  
  
  

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

2005-01-11 Thread kinman
kinman  2005/01/11 14:14:55

  Modified:jasper2/src/share/org/apache/jasper/compiler
ParserController.java
  Log:
  - Fix 29771: page encoding in a page directive inside a comment should be 
ignored.
  
  Revision  ChangesPath
  1.56  +19 -52
jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/compiler/ParserController.java
  
  Index: ParserController.java
  ===
  RCS file: 
/home/cvs/jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/compiler/ParserController.java,v
  retrieving revision 1.55
  retrieving revision 1.56
  diff -u -r1.55 -r1.56
  --- ParserController.java 23 Sep 2004 06:59:09 -  1.55
  +++ ParserController.java 11 Jan 2005 22:14:55 -  1.56
  @@ -401,40 +401,31 @@
   jspReader.reset(startMark);
   
/*
  -  * Determine page encoding from directive of the form %@ page % or
  -  * %@ tag %
  +  * Determine page encoding from directive of the form %@ page %,
  +  * %@ tag %, jsp:directive.page  or jsp:directive.tag .
 */
   while (true) {
  -Mark current = jspReader.mark();
  -
  -Mark beginDirective = jspReader.skipUntil(%@);
  -if (beginDirective == null) {
  +if (jspReader.skipUntil() == null) {
   break;
   }
  -// Move past the '%@' delimiter
  -Mark beginDirectiveBody = jspReader.mark();
  -
  -// Check to see if directive is nested inside comment
  -jspReader.reset(current);
  -Mark beginComment = jspReader.skipUntil(%--);
  -if (beginComment != null) {
  -Mark endComment = jspReader.skipUntil(--%);
  -if (endComment == null) {
  -err.jspError(beginComment, jsp.error.unterminated,
  - lt;%--);
  -}
  -  
  -if (beginDirective.isGreater(beginComment)
  - endComment.isGreater(beginDirective)) {
  -// Directive is nested inside comment, skip until end of 
  -// comment
  -jspReader.reset(endComment);
  -continue;
  +// If this is a comment, skip until its end
  +if (jspReader.matches(%--)) {
  +if (jspReader.skipUntil(--%) == null) {
  +// error will be caught in Parser
  +break;
   }
  +continue;
  +}
  +boolean isDirective = jspReader.matches(%@);
  +if (isDirective) {
  + jspReader.skipSpaces();
  +}
  +else {
  +isDirective = jspReader.matches(jsp:directive.);
  +}
  +if (!isDirective) {
  +continue;
   }
  -
  -jspReader.reset(beginDirectiveBody);
  - jspReader.skipSpaces();
   
// compare for tag , so we don't match taglib
if (jspReader.matches(tag ) || jspReader.matches(page)) {
  @@ -455,30 +446,6 @@
   if (encoding == null) {
   encoding = saveEncoding;
   }
  -
  - if (encoding == null) {
  - /*
  -  * Determine page encoding from page directive of the form
  -  * jsp:directive.page
  -  */
  - jspReader.reset(startMark);
  - while (jspReader.skipUntil(jsp:directive.page) != null) {
  - jspReader.skipSpaces();
  -Attributes attrs = Parser.parseAttributes(this, jspReader);
  -
  - encoding = getPageEncodingFromDirective(attrs, pageEncoding);
  -if (encoding != null) {
  -break;
  -}
  - encoding = getPageEncodingFromDirective(attrs, contentType);
  -if (encoding != null) {
  -saveEncoding = encoding;
  -}
  - }
  -if (encoding == null) {
  -encoding = saveEncoding;
  -}
  - }
   
return encoding;
   }
  
  
  

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



cvs commit: jakarta-servletapi-5/jsr152/examples/num numguess.jsp

2005-01-11 Thread kinman
kinman  2005/01/11 15:36:20

  Modified:jsr152/examples/num numguess.jsp
  Log:
  - Fix 32456: Remove extra !--
  
  Revision  ChangesPath
  1.3   +0 -1  jakarta-servletapi-5/jsr152/examples/num/numguess.jsp
  
  Index: numguess.jsp
  ===
  RCS file: /home/cvs/jakarta-servletapi-5/jsr152/examples/num/numguess.jsp,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- numguess.jsp  18 Mar 2004 16:40:31 -  1.2
  +++ numguess.jsp  11 Jan 2005 23:36:20 -  1.3
  @@ -1,5 +1,4 @@
   !--
  -!--
 Copyright 2004 The Apache Software Foundation
   
 Licensed under the Apache License, Version 2.0 (the License);
  
  
  

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

2004-10-14 Thread kinman
kinman  2004/10/14 16:54:01

  Modified:jasper2/src/share/org/apache/jasper/compiler Compiler.java
  Log:
  - Fix bugzilla 31382: Stack overflow when compiling recursive tag files.
  
  Revision  ChangesPath
  1.97  +23 -30
jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/compiler/Compiler.java
  
  Index: Compiler.java
  ===
  RCS file: 
/home/cvs/jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/compiler/Compiler.java,v
  retrieving revision 1.96
  retrieving revision 1.97
  diff -u -r1.96 -r1.97
  --- Compiler.java 5 Oct 2004 19:28:19 -   1.96
  +++ Compiler.java 14 Oct 2004 23:54:00 -  1.97
  @@ -326,7 +326,6 @@
*/
   public boolean isOutDated(boolean checkClass) {
   
  -boolean outDated = false;
   String jsp = ctxt.getJspFile();
   
   if ((jsw != null)
  @@ -362,31 +361,31 @@
   }
   
   if (!targetFile.exists()) {
  -outDated = true;
  -} else {
  -targetLastModified = targetFile.lastModified();
  -if (checkClass  jsw != null) {
  -jsw.setServletClassLastModifiedTime(targetLastModified);
  -}   
  -if (targetLastModified  jspRealLastModified) {
  -if( log.isDebugEnabled() ) {
  -log.debug(Compiler: outdated:  + targetFile +   +
  -targetLastModified );
  -}
  -outDated = true;
  +return true;
  +}
  +
  +targetLastModified = targetFile.lastModified();
  +if (checkClass  jsw != null) {
  +jsw.setServletClassLastModifiedTime(targetLastModified);
  +}   
  +if (targetLastModified  jspRealLastModified) {
  +if( log.isDebugEnabled() ) {
  +log.debug(Compiler: outdated:  + targetFile +   +
  +targetLastModified );
   }
  +return true;
   }
   
   // determine if source dependent files (e.g. includes using include
   // directives) have been changed.
   if( jsw==null ) {
  -return outDated;
  +return false;
   }
   jsw.setLastModificationTest(System.currentTimeMillis());
   
   List depends = jsw.getDependants();
   if (depends == null) {
  -return outDated;
  +return false;
   }
   
   Iterator it = depends.iterator();
  @@ -395,29 +394,23 @@
   try {
   URL includeUrl = ctxt.getResource(include);
   if (includeUrl == null) {
  -outDated = true;
  +return true;
   }
  -if (!outDated) {
   
  -URLConnection includeUconn = includeUrl.openConnection();
  -long includeLastModified = includeUconn.getLastModified();
  -includeUconn.getInputStream().close();
  -
  -if (includeLastModified  targetLastModified) {
  -outDated = true;
  -}
  -}
  -if (outDated) {
  -// Remove any potential Wrappers for tag files
  -ctxt.getRuntimeContext().removeWrapper(include);
  +URLConnection includeUconn = includeUrl.openConnection();
  +long includeLastModified = includeUconn.getLastModified();
  +includeUconn.getInputStream().close();
  +
  +if (includeLastModified  targetLastModified) {
  +return true;
   }
   } catch (Exception e) {
   e.printStackTrace();
  -outDated = true;
  +return true;
   }
   }
   
  -return outDated;
  +return false;
   
   }
   
  
  
  

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

2004-09-07 Thread kinman
kinman  2004/09/07 13:15:37

  Modified:jasper2/src/share/org/apache/jasper/compiler JspUtil.java
  Log:
  - Fix 31098: Update java keywords for the latest language spec.
  
  Revision  ChangesPath
  1.50  +2 -2  
jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/compiler/JspUtil.java
  
  Index: JspUtil.java
  ===
  RCS file: 
/home/cvs/jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/compiler/JspUtil.java,v
  retrieving revision 1.49
  retrieving revision 1.50
  diff -u -r1.49 -r1.50
  --- JspUtil.java  11 Jun 2004 00:29:56 -  1.49
  +++ JspUtil.java  7 Sep 2004 20:15:37 -   1.50
  @@ -62,9 +62,9 @@
= new ExpressionEvaluatorImpl();
   
   private static final String javaKeywords[] = {
  -abstract, boolean, break, byte, case,
  +abstract, assert, boolean, break, byte, case,
   catch, char, class, const, continue,
  -default, do, double, else, extends,
  +default, do, double, else, enum, extends,
   final, finally, float, for, goto,
   if, implements, import, instanceof, int,
   interface, long, native, new, package,
  
  
  

-
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 JspDocumentParser.java ParserController.java

2004-08-16 Thread kinman
kinman  2004/08/16 15:35:38

  Modified:jasper2/src/share/org/apache/jasper/compiler
JspDocumentParser.java ParserController.java
  Log:
  - Close any InputStream open in JspDocumentParser.
  
  Revision  ChangesPath
  1.83  +24 -37
jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/compiler/JspDocumentParser.java
  
  Index: JspDocumentParser.java
  ===
  RCS file: 
/home/cvs/jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/compiler/JspDocumentParser.java,v
  retrieving revision 1.82
  retrieving revision 1.83
  diff -u -r1.82 -r1.83
  --- JspDocumentParser.java13 Jul 2004 20:38:56 -  1.82
  +++ JspDocumentParser.java16 Aug 2004 22:35:37 -  1.83
  @@ -18,6 +18,8 @@
   import java.io.CharArrayWriter;
   import java.io.FileNotFoundException;
   import java.io.IOException;
  +import java.io.InputStream;
  +
   import java.util.Iterator;
   import java.util.List;
   import java.util.jar.JarFile;
  @@ -166,24 +168,32 @@
   
   // Parse the input
   SAXParser saxParser = getSAXParser(false, jspDocParser);
  +InputStream inStream = null;
   try {
  -saxParser.parse(
  -jspDocParser.getInputSource(
  -path,
  -jarFile,
  -jspDocParser.ctxt,
  -jspDocParser.err),
  -jspDocParser);
  +inStream = JspUtil.getInputStream(path, jarFile,
  +  jspDocParser.ctxt,
  +  jspDocParser.err);
  +saxParser.parse(new InputSource(inStream), jspDocParser);
   } catch (EnableDTDValidationException e) {
   saxParser = getSAXParser(true, jspDocParser);
   jspDocParser.isValidating = true;
  -saxParser.parse(
  -jspDocParser.getInputSource(
  -path,
  -jarFile,
  -jspDocParser.ctxt,
  -jspDocParser.err),
  -jspDocParser);
  +if (inStream != null) {
  +try {
  +inStream.close();
  +} catch (Exception any) {
  +}
  +}
  +inStream = JspUtil.getInputStream(path, jarFile,
  +  jspDocParser.ctxt,
  +  jspDocParser.err);
  +saxParser.parse(new InputSource(inStream), jspDocParser);
  +} finally {
  +if (inStream != null) {
  +try {
  +inStream.close();
  +} catch (Exception any) {
  +}
  +}
   }
   
   if (parent == null) {
  @@ -1369,29 +1379,6 @@
   xmlReader.setErrorHandler(jspDocParser);
   
   return saxParser;
  -}
  -
  -/*
  - * Gets an InputSource to the JSP document or tag file to be parsed.
  - *
  - * @param path The path to the JSP document or tag file to be parsed
  - * @param jarFile The JAR file from which to read the JSP document or tag
  - * file, or null if the JSP document or tag file is to be read from the
  - * filesystem
  - * @param ctxt The JSP compilation context
  - * @param err The error dispatcher
  - *
  - * @return An InputSource to the requested JSP document or tag file
  - */
  -private InputSource getInputSource(
  -String path,
  -JarFile jarFile,
  -JspCompilationContext ctxt,
  -ErrorDispatcher err)
  -throws Exception {
  -
  -return new InputSource(
  -JspUtil.getInputStream(path, jarFile, ctxt, err));
   }
   
   /*
  
  
  
  1.54  +8 -16 
jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/compiler/ParserController.java
  
  Index: ParserController.java
  ===
  RCS file: 
/home/cvs/jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/compiler/ParserController.java,v
  retrieving revision 1.53
  retrieving revision 1.54
  diff -u -r1.53 -r1.54
  --- ParserController.java 12 Jul 2004 22:54:33 -  1.53
  +++ ParserController.java 16 Aug 2004 22:35:37 -  1.54
  @@ -192,22 +192,14 @@
// Dispatch to the appropriate parser
if (isXml) {
// JSP document (XML syntax)
  - InputStream inStream = null;
  - try {
  - parsedPage = JspDocumentParser.parse(this, absFileName,
  -  jarFile, parent

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

2004-07-27 Thread kinman
kinman  2004/07/27 14:57:03

  Modified:jasper2/src/share/org/apache/jasper/compiler JspReader.java
  Log:
  - Replace tabs with 8 spaces, in preparation for next commit.
  
  Revision  ChangesPath
  1.22  +250 -250  
jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/compiler/JspReader.java
  
  Index: JspReader.java
  ===
  RCS file: 
/home/cvs/jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/compiler/JspReader.java,v
  retrieving revision 1.21
  retrieving revision 1.22
  diff -u -r1.21 -r1.22
  --- JspReader.java13 Jul 2004 18:40:08 -  1.21
  +++ JspReader.java27 Jul 2004 21:57:02 -  1.22
  @@ -70,34 +70,34 @@
* Constructor.
*/
   public JspReader(JspCompilationContext ctxt,
  -  String fname,
  -  String encoding,
  -  JarFile jarFile,
  -  ErrorDispatcher err)
  - throws JasperException, FileNotFoundException, IOException {
  -
  - this(ctxt, fname, encoding,
  -  JspUtil.getReader(fname, encoding, jarFile, ctxt, err),
  -  err);
  + String fname,
  + String encoding,
  + JarFile jarFile,
  + ErrorDispatcher err)
  +throws JasperException, FileNotFoundException, IOException {
  +
  +this(ctxt, fname, encoding,
  + JspUtil.getReader(fname, encoding, jarFile, ctxt, err),
  + err);
   }
   
   /*
* Constructor.
*/
   public JspReader(JspCompilationContext ctxt,
  -  String fname,
  -  String encoding,
  -  InputStreamReader reader,
  -  ErrorDispatcher err)
  - throws JasperException, FileNotFoundException {
  + String fname,
  + String encoding,
  + InputStreamReader reader,
  + ErrorDispatcher err)
  +throws JasperException, FileNotFoundException {
   
   this.context = ctxt;
  - this.err = err;
  - sourceFiles = new Vector();
  - currFileId = 0;
  - size = 0;
  - singleFile = false;
  - pushFile(fname, encoding, reader);
  +this.err = err;
  +sourceFiles = new Vector();
  +currFileId = 0;
  +size = 0;
  +singleFile = false;
  +pushFile(fname, encoding, reader);
   }
   
   /*
  @@ -109,35 +109,35 @@
   }
   
   String getFile(int fileid) {
  - return (String) sourceFiles.elementAt(fileid);
  +return (String) sourceFiles.elementAt(fileid);
   }
  - 
  +
   boolean hasMoreInput() throws JasperException {
  - if (current.cursor = current.stream.length) {
  +if (current.cursor = current.stream.length) {
   if (singleFile) return false; 
  - while (popFile()) {
  - if (current.cursor  current.stream.length) return true;
  - }
  - return false;
  - }
  - return true;
  +while (popFile()) {
  +if (current.cursor  current.stream.length) return true;
  +}
  +return false;
  +}
  +return true;
   }
   
   int nextChar() throws JasperException {
  - if (!hasMoreInput())
  - return -1;
  - 
  - int ch = current.stream[current.cursor];
  -
  - current.cursor++;
  - 
  - if (ch == '\n') {
  - current.line++;
  - current.col = 0;
  - } else {
  - current.col++;
  - }
  - return ch;
  +if (!hasMoreInput())
  +return -1;
  +
  +int ch = current.stream[current.cursor];
  +
  +current.cursor++;
  +
  +if (ch == '\n') {
  +current.line++;
  +current.col = 0;
  +} else {
  +current.col++;
  +}
  +return ch;
   }
   
   /**
  @@ -145,46 +145,46 @@
* and that the char to be pushed back is not '\n'.
*/
   void pushChar() {
  - current.cursor--;
  - current.col--;
  +current.cursor--;
  +current.col--;
   }
   
   String getText(Mark start, Mark stop) throws JasperException {
  - Mark oldstart = mark();
  - reset(start);
  - CharArrayWriter caw = new CharArrayWriter();
  - while (!stop.equals(mark()))
  - caw.write(nextChar());
  - caw.close();
  - reset(oldstart);
  - return caw.toString();
  +Mark oldstart = mark();
  +reset(start);
  +CharArrayWriter caw = new CharArrayWriter();
  +while (!stop.equals(mark()))
  +caw.write(nextChar());
  +caw.close();
  +reset(oldstart);
  +return caw.toString();
   }
   
   int peekChar() {
  - return current.stream

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

2004-07-26 Thread kinman
kinman  2004/07/26 13:50:36

  Modified:jasper2/src/share/org/apache/jasper/compiler Generator.java
  Log:
  - Fix 30291: Smap for a tag should not include its body.
  - Fix 30289: Incorrect Smap for multiple line java expression.
  
  Revision  ChangesPath
  1.236 +8 -5  
jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/compiler/Generator.java
  
  Index: Generator.java
  ===
  RCS file: 
/home/cvs/jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/compiler/Generator.java,v
  retrieving revision 1.235
  retrieving revision 1.236
  diff -u -r1.235 -r1.236
  --- Generator.java23 Jul 2004 22:45:38 -  1.235
  +++ Generator.java26 Jul 2004 20:50:35 -  1.236
  @@ -830,7 +830,9 @@
   
   public void visit(Node.Expression n) throws JasperException {
   n.setBeginJavaLine(out.getJavaLine());
  -out.printil(out.print( + n.getText() + ););
  +out.printin(out.print();
  +out.printMultiLn(n.getText());
  +out.println(););
   n.setEndJavaLine(out.getJavaLine());
   }
   
  @@ -2125,9 +2127,9 @@
   
   Class tagHandlerClass = handlerInfo.getTagHandlerClass();
   
  -n.setBeginJavaLine(out.getJavaLine());
   out.printin(//  );
   out.println(n.getQName());
  +n.setBeginJavaLine(out.getJavaLine());
   
   // Declare AT_BEGIN scripting variables
   declareScriptingVars(n, VariableInfo.AT_BEGIN);
  @@ -2221,7 +2223,10 @@
   out.pushIndent();
   }
   }
  -};
  +// Map the Java lines that handles start of custom tags to the
  +// JSP line for this tag
  +n.setEndJavaLine(out.getJavaLine());
  +}
   
   private void generateCustomEnd(
   Node.CustomTag n,
  @@ -2327,8 +2332,6 @@
   syncScriptingVars(n, VariableInfo.AT_END);
   
   restoreScriptingVars(n, VariableInfo.AT_BEGIN);
  -
  -n.setEndJavaLine(out.getJavaLine());
   }
   
   private void generateCustomDoTag(
  
  
  

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



cvs commit: jakarta-servletapi-5/jsr152/examples/jsp2/jspx basic.jspx

2004-07-16 Thread kinman
kinman  2004/07/16 14:42:07

  Modified:jsr152/examples/jsp2/jspx basic.jspx
  Log:
  - Bugzilla 30159: typo in example.
  
  Revision  ChangesPath
  1.5   +1 -1  jakarta-servletapi-5/jsr152/examples/jsp2/jspx/basic.jspx
  
  Index: basic.jspx
  ===
  RCS file: /home/cvs/jakarta-servletapi-5/jsr152/examples/jsp2/jspx/basic.jspx,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- basic.jspx21 Nov 2003 22:06:02 -  1.4
  +++ basic.jspx16 Jul 2004 21:42:07 -  1.5
  @@ -23,7 +23,7 @@
   namespace declarations to make the output of this page a valid XHTML
   Basic document.
   p/
  -Just to proove this is live, here's some dynamic content:
  +Just to prove this is live, here's some dynamic content:
   jsp:useBean id=now class=java.util.Date /
   fmt:formatDate value=${now} pattern= d, , H:mm:ss/
 /body
  
  
  

-
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 Compiler.java PageInfo.java

2004-07-13 Thread kinman
kinman  2004/07/13 15:47:23

  Modified:jasper2/src/share/org/apache/jasper/compiler Compiler.java
PageInfo.java
  Log:
  -- Fix bugzilla 29887: Recursive tag file causes infinite recursion when
checking for file dependencies.
  
  Revision  ChangesPath
  1.91  +2 -1  
jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/compiler/Compiler.java
  
  Index: Compiler.java
  ===
  RCS file: 
/home/cvs/jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/compiler/Compiler.java,v
  retrieving revision 1.90
  retrieving revision 1.91
  diff -u -r1.90 -r1.91
  --- Compiler.java 7 Jul 2004 16:29:10 -   1.90
  +++ Compiler.java 13 Jul 2004 22:47:23 -  1.91
  @@ -154,7 +154,8 @@
   
   // Setup page info area
   pageInfo = new PageInfo(new BeanRepository(ctxt.getClassLoader(),
  -   errDispatcher));
  +   errDispatcher),
  +ctxt.getJspFile());
   
   JspConfig jspConfig = options.getJspConfig();
   JspConfig.JspProperty jspProperty =
  
  
  
  1.42  +9 -2  
jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/compiler/PageInfo.java
  
  Index: PageInfo.java
  ===
  RCS file: 
/home/cvs/jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/compiler/PageInfo.java,v
  retrieving revision 1.41
  retrieving revision 1.42
  diff -u -r1.41 -r1.42
  --- PageInfo.java 17 Mar 2004 19:23:03 -  1.41
  +++ PageInfo.java 13 Jul 2004 22:47:23 -  1.42
  @@ -37,6 +37,7 @@
   private HashMap jspPrefixMapper;
   private HashMap xmlPrefixMapper;
   private HashMap nonCustomTagPrefixMap;
  +private String jspFile;
   private String defaultLanguage = java;
   private String language;
   private String defaultExtends = Constants.JSP_SERVLET_BASE;
  @@ -76,7 +77,9 @@
   private Vector pluginDcls;   // Id's for tagplugin declarations
   
   
  -PageInfo(BeanRepository beanRepository) {
  +PageInfo(BeanRepository beanRepository, String jspFile) {
  +
  +this.jspFile = jspFile;
this.beanRepository = beanRepository;
this.taglibsMap = new HashMap();
this.jspPrefixMapper = new HashMap();
  @@ -118,8 +121,12 @@
return imports;
   }
   
  +public String getJspFile() {
  +return jspFile;
  +}
  +
   public void addDependant(String d) {
  - if (!dependants.contains(d))
  + if (!dependants.contains(d)  !jspFile.equals(d))
   dependants.add(d);
   }

  
  
  

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

2004-06-10 Thread kinman
kinman  2004/06/10 14:17:28

  Modified:jasper2/src/share/org/apache/jasper/compiler Generator.java
  Log:
  - Fixed 29478: bean instantiations should be avoided at compilation time.
  
Patch by Jess Holle
  
  Revision  ChangesPath
  1.233 +9 -1  
jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/compiler/Generator.java
  
  Index: Generator.java
  ===
  RCS file: 
/home/cvs/jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/compiler/Generator.java,v
  retrieving revision 1.232
  retrieving revision 1.233
  diff -u -r1.232 -r1.233
  --- Generator.java19 Apr 2004 21:10:19 -  1.232
  +++ Generator.java10 Jun 2004 21:17:28 -  1.233
  @@ -21,6 +21,7 @@
   import java.beans.Introspector;
   import java.beans.PropertyDescriptor;
   import java.lang.reflect.Method;
  +import java.lang.reflect.Modifier;
   import java.util.ArrayList;
   import java.util.Arrays;
   import java.util.Collections;
  @@ -1209,7 +1210,14 @@
   if (beanName == null) {
   try {
   Class bean = ctxt.getClassLoader().loadClass(klass);
  -bean.newInstance();
  +int modifiers = bean.getModifiers();
  +if (!Modifier.isPublic(modifiers) ||
  +Modifier.isInterface(modifiers) ||
  +Modifier.isAbstract(modifiers)) {
  +throw new Exception(Invalid bean class modifier);
  +}
  +// Check that there is a 0 arg constructor
  +bean.getConstructor(new Class[] {});
   generateNew = true;
   } catch (Exception e) {
   // Cannot instantiate the specified class
  
  
  

-
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 Generator.java JspUtil.java

2004-06-10 Thread kinman
kinman  2004/06/10 17:29:57

  Modified:jasper2/src/share/org/apache/jasper/compiler Generator.java
JspUtil.java
  Log:
  - If the value of the type attribute of the attribute directive
is an array, allow it to be specified as [Lclassname;
  
  Revision  ChangesPath
  1.234 +3 -3  
jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/compiler/Generator.java
  
  Index: Generator.java
  ===
  RCS file: 
/home/cvs/jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/compiler/Generator.java,v
  retrieving revision 1.233
  retrieving revision 1.234
  diff -u -r1.233 -r1.234
  --- Generator.java10 Jun 2004 21:17:28 -  1.233
  +++ Generator.java11 Jun 2004 00:29:56 -  1.234
  @@ -3444,7 +3444,7 @@
   if (attrInfos[i].isFragment()) {
   out.print(javax.servlet.jsp.tagext.JspFragment );
   } else {
  -out.print(attrInfos[i].getTypeName());
  +out.print(JspUtil.toJavaSourceType(attrInfos[i].getTypeName()));
   out.print( );
   }
   out.print(attrInfos[i].getName());
  @@ -3460,7 +3460,7 @@
   if (attrInfos[i].isFragment()) {
   out.print(javax.servlet.jsp.tagext.JspFragment );
   } else {
  -out.print(attrInfos[i].getTypeName());
  +out.print(JspUtil.toJavaSourceType(attrInfos[i].getTypeName()));
   out.print( );
   }
   out.print(toGetterMethod(attrInfos[i].getName()));
  @@ -3480,7 +3480,7 @@
   out.print((javax.servlet.jsp.tagext.JspFragment );
   } else {
   out.print(();
  -out.print(attrInfos[i].getTypeName());
  +out.print(JspUtil.toJavaSourceType(attrInfos[i].getTypeName()));
   out.print( );
   }
   out.print(attrInfos[i].getName());
  
  
  
  1.49  +1 -1  
jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/compiler/JspUtil.java
  
  Index: JspUtil.java
  ===
  RCS file: 
/home/cvs/jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/compiler/JspUtil.java,v
  retrieving revision 1.48
  retrieving revision 1.49
  diff -u -r1.48 -r1.49
  --- JspUtil.java  19 Apr 2004 21:10:19 -  1.48
  +++ JspUtil.java  11 Jun 2004 00:29:56 -  1.49
  @@ -1047,7 +1047,7 @@
* the element type can be one of ZBCDFIJS or Lclassname;
* It is converted into forms that can be understood by javac.
*/
  -private static String toJavaSourceType(String type) {
  +public static String toJavaSourceType(String type) {
   
if (type.charAt(0) != '[') {
return type;
  
  
  

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



cvs commit: jakarta-servletapi-5/jsr152/examples/WEB-INF/jsp2 jsp2-example-taglib.tld

2004-05-21 Thread kinman
kinman  2004/05/21 13:55:42

  Modified:jsr152/examples/WEB-INF/jsp2 jsp2-example-taglib.tld
  Log:
  - Fix 29100: Invalid schemalocations specified for tld in jsp-examples.
  
  Revision  ChangesPath
  1.5   +1 -1  
jakarta-servletapi-5/jsr152/examples/WEB-INF/jsp2/jsp2-example-taglib.tld
  
  Index: jsp2-example-taglib.tld
  ===
  RCS file: 
/home/cvs/jakarta-servletapi-5/jsr152/examples/WEB-INF/jsp2/jsp2-example-taglib.tld,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- jsp2-example-taglib.tld   18 Mar 2004 16:40:29 -  1.4
  +++ jsp2-example-taglib.tld   21 May 2004 20:55:41 -  1.5
  @@ -17,7 +17,7 @@
   
   taglib xmlns=http://java.sun.com/xml/ns/j2ee;
   xmlns:xsi=http://www.w3.org/2001/XMLSchema-instance;
  -xsi:schemaLocation=http://java.sun.com/xml/ns/j2ee web-jsptaglibrary_2_0.xsd
  +xsi:schemaLocation=http://java.sun.com/xml/ns/j2ee 
http://java.sun.com/xml/ns/j2ee/web-jsptaglibrary_2_0.xsd;
   version=2.0
   descriptionA tag library exercising SimpleTag handlers./description
   tlib-version1.0/tlib-version
  
  
  

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

2004-05-11 Thread kinman
kinman  2004/05/11 18:14:59

  Modified:jasper2/src/share/org/apache/jasper/compiler
PageDataImpl.java Validator.java
  Log:
  - Fix 28696: xsi:schemaLocation should be a valid attribute for jsp:root.
  
  Revision  ChangesPath
  1.38  +1 -0  
jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/compiler/PageDataImpl.java
  
  Index: PageDataImpl.java
  ===
  RCS file: 
/home/cvs/jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/compiler/PageDataImpl.java,v
  retrieving revision 1.37
  retrieving revision 1.38
  diff -u -r1.37 -r1.38
  --- PageDataImpl.java 17 Mar 2004 19:23:03 -  1.37
  +++ PageDataImpl.java 12 May 2004 01:14:59 -  1.38
  @@ -160,6 +160,7 @@
   
public void visit(Node.JspRoot n) throws JasperException {
addAttributes(n.getTaglibAttributes());
  +addAttributes(n.getNonTaglibXmlnsAttributes());
addAttributes(n.getAttributes());
   
visitBody(n);
  
  
  
  1.117 +1 -0  
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.116
  retrieving revision 1.117
  diff -u -r1.116 -r1.117
  --- Validator.java17 Mar 2004 19:23:03 -  1.116
  +++ Validator.java12 May 2004 01:14:59 -  1.117
  @@ -300,6 +300,7 @@
   private ClassLoader loader;
   
private static final JspUtil.ValidAttribute[] jspRootAttrs = {
  +new JspUtil.ValidAttribute(xsi:schemaLocation),
new JspUtil.ValidAttribute(version, true) };
   
private static final JspUtil.ValidAttribute[] includeDirectiveAttrs = {
  
  
  

-
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 Generator.java JspUtil.java

2004-04-19 Thread kinman
kinman  2004/04/19 14:10:19

  Modified:jasper2/src/share/org/apache/jasper/compiler Generator.java
JspUtil.java
  Log:
  - Fix 28380: Javac error with ':' and '.' in attribute names.
  
  Revision  ChangesPath
  1.232 +7 -29 
jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/compiler/Generator.java
  
  Index: Generator.java
  ===
  RCS file: 
/home/cvs/jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/compiler/Generator.java,v
  retrieving revision 1.231
  retrieving revision 1.232
  diff -u -r1.231 -r1.232
  --- Generator.java5 Apr 2004 16:07:41 -   1.231
  +++ Generator.java19 Apr 2004 21:10:19 -  1.232
  @@ -254,18 +254,6 @@
   boolean hasEmptyBody) {
   String poolName = null;
   
  -if (prefix.indexOf('-') = 0)
  -prefix = JspUtil.replace(prefix, '-', $1);
  -if (prefix.indexOf('.') = 0)
  -prefix = JspUtil.replace(prefix, '.', $2);
  -
  -if (shortName.indexOf('-') = 0)
  -shortName = JspUtil.replace(shortName, '-', $1);
  -if (shortName.indexOf('.') = 0)
  -shortName = JspUtil.replace(shortName, '.', $2);
  -if (shortName.indexOf(':') = 0)
  -shortName = JspUtil.replace(shortName, ':', $3);
  -
   poolName = _jspx_tagPool_ + prefix + _ + shortName;
   if (attrs != null) {
   String[] attrNames = new String[attrs.getLength()];
  @@ -280,7 +268,7 @@
   if (hasEmptyBody) {
   poolName = poolName + _nobody;
   }
  -return poolName;
  +return JspUtil.makeXmlJavaIdentifier(poolName);
   }
   }
   
  @@ -2617,37 +2605,27 @@
   
   /*
* Creates a tag variable name by concatenating the given prefix and
  - * shortName and replacing '-' with $1, '.' with $2, and ':' with
  - * $3.
  + * shortName and endcoded to make the resultant string a valid Java
  + * Identifier.
*/
   private String createTagVarName(
   String fullName,
   String prefix,
   String shortName) {
  -if (prefix.indexOf('-') = 0)
  -prefix = JspUtil.replace(prefix, '-', $1);
  -if (prefix.indexOf('.') = 0)
  -prefix = JspUtil.replace(prefix, '.', $2);
  -
  -if (shortName.indexOf('-') = 0)
  -shortName = JspUtil.replace(shortName, '-', $1);
  -if (shortName.indexOf('.') = 0)
  -shortName = JspUtil.replace(shortName, '.', $2);
  -if (shortName.indexOf(':') = 0)
  -shortName = JspUtil.replace(shortName, ':', $3);
   
  +String varName;
   synchronized (tagVarNumbers) {
  -String varName = prefix + _ + shortName + _;
  +varName = prefix + _ + shortName + _;
   if (tagVarNumbers.get(fullName) != null) {
   Integer i = (Integer)tagVarNumbers.get(fullName);
   varName = varName + i.intValue();
   tagVarNumbers.put(fullName, new Integer(i.intValue() + 1));
  -return varName;
   } else {
   tagVarNumbers.put(fullName, new Integer(1));
  -return varName + 0;
  +varName = varName + 0;
   }
   }
  +return JspUtil.makeXmlJavaIdentifier(varName);
   }
   
   private String evaluateAttribute(
  
  
  
  1.48  +21 -0 
jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/compiler/JspUtil.java
  
  Index: JspUtil.java
  ===
  RCS file: 
/home/cvs/jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/compiler/JspUtil.java,v
  retrieving revision 1.47
  retrieving revision 1.48
  diff -u -r1.47 -r1.48
  --- JspUtil.java  17 Mar 2004 19:23:03 -  1.47
  +++ JspUtil.java  19 Apr 2004 21:10:19 -  1.48
  @@ -1003,6 +1003,27 @@
   return false;
   }
   
  +/**
  + * Converts the given Xml name to a legal Java identifier.  This is
  + * slightly more efficient than makeJavaIdentifier in that we only need
  + * to worry about '.', '-', and ':' in the string.  We also assume that
  + * the resultant string is further concatenated with some prefix string
  + * so that we don't have to worry about it being a Java key word.
  + *
  + * @param name Identifier to convert
  + *
  + * @return Legal Java identifier corresponding to the given identifier
  + */
  +public static final

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

2004-04-16 Thread kinman
kinman  2004/04/16 16:22:30

  Modified:jasper2/src/share/org/apache/jasper/compiler
JspDocumentParser.java
  Log:
  - Fix a bug where a custom tag with tagdependent body type is not
handled correctly in XML syntax.  The fix would have been trivial if not
for the cases where jsp:attribute and/or jsp:body is present.
  
  Revision  ChangesPath
  1.79  +97 -10
jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/compiler/JspDocumentParser.java
  
  Index: JspDocumentParser.java
  ===
  RCS file: 
/home/cvs/jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/compiler/JspDocumentParser.java,v
  retrieving revision 1.78
  retrieving revision 1.79
  diff -u -r1.78 -r1.79
  --- JspDocumentParser.java13 Apr 2004 22:55:50 -  1.78
  +++ JspDocumentParser.java16 Apr 2004 23:22:30 -  1.79
  @@ -102,13 +102,18 @@
   private boolean directivesOnly;
   private boolean isTop;
   
  +// Nesting level of Tag dependent bodies
  +private int tagDependentNesting = 0;
  +// Flag set to delay incrmenting tagDependentNesting until jsp:body
  +// is first encountered
  +private boolean tagDependentPending = false;
  +
   /*
* Constructor
*/
   public JspDocumentParser(
   ParserController pc,
   String path,
  -JarFile jarFile,
   boolean isTagFile,
   boolean directivesOnly) {
   this.parserController = pc;
  @@ -139,7 +144,7 @@
   throws JasperException {
   
   JspDocumentParser jspDocParser =
  -new JspDocumentParser(pc, path, jarFile, isTagFile, directivesOnly);
  +new JspDocumentParser(pc, path, isTagFile, directivesOnly);
   Node.Nodes pageNodes = null;
   
   try {
  @@ -324,7 +329,52 @@
   
   Node node = null;
   
  -if (JSP_URI.equals(uri)) {
  +if (tagDependentPending  JSP_URI.equals(uri) 
  + localName.equals(BODY_ACTION)) {
  +tagDependentNesting++;
  +current =
  +parseStandardAction(
  +qName,
  +localName,
  +nonTaglibAttrs,
  +nonTaglibXmlnsAttrs,
  +taglibAttrs,
  +startMark,
  +current);
  +tagDependentPending = false;
  +return;
  +}
  +
  +if (tagDependentPending  JSP_URI.equals(uri) 
  + localName.equals(ATTRIBUTE_ACTION)) {
  +current =
  +parseStandardAction(
  +qName,
  +localName,
  +nonTaglibAttrs,
  +nonTaglibXmlnsAttrs,
  +taglibAttrs,
  +startMark,
  +current);
  +return;
  +}
  +
  +if (tagDependentPending) {
  +tagDependentPending = false;
  +tagDependentNesting++;
  +}
  +
  +if (tagDependentNesting  0) {
  +node =
  +new Node.UninterpretedTag(
  +qName,
  +localName,
  +nonTaglibAttrs,
  +nonTaglibXmlnsAttrs,
  +taglibAttrs,
  +startMark,
  +current);
  +} else if (JSP_URI.equals(uri)) {
   node =
   parseStandardAction(
   qName,
  @@ -357,17 +407,15 @@
   current);
   } else {
   // custom action
  -Node.CustomTag custom = (Node.CustomTag) node;
  - String bodyType;
  - if (custom.getTagInfo() != null) {
  - bodyType = custom.getTagInfo().getBodyContent();
  - } else {
  - bodyType = custom.getTagFileInfo().getTagInfo().getBodyContent();
  - }
  + String bodyType = getBodyType((Node.CustomTag) node);
  +
   if (scriptlessBodyNode == null

bodyType.equalsIgnoreCase(TagInfo.BODY_CONTENT_SCRIPTLESS)) {
   scriptlessBodyNode = node;
   }
  +else if 
(TagInfo.BODY_CONTENT_TAG_DEPENDENT.equalsIgnoreCase(bodyType)) {
  +tagDependentPending = true;
  +}
   }
   }
   
  @@ -425,6 +473,22 @@
   }
   }
   }
  +
  +if (!isAllSpace  tagDependentPending) {
  +tagDependentPending = false;
  +tagDependentNesting++;
  +}
  +
  +if (tagDependentNesting  0) {
  +if (charBuffer.length()  0) {
  +new Node.TemplateText(charBuffer.toString(), startMark, current

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

2004-04-07 Thread kinman
kinman  2004/04/07 13:41:32

  Modified:jasper2/src/share/org/apache/jasper/compiler Node.java
  Log:
  - Fix bugzilla 28244: XML Comment between jsp:attribute causes attributes after
the comment to be ignored
  
  Revision  ChangesPath
  1.82  +1 -1  
jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/compiler/Node.java
  
  Index: Node.java
  ===
  RCS file: 
/home/cvs/jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/compiler/Node.java,v
  retrieving revision 1.81
  retrieving revision 1.82
  diff -u -r1.81 -r1.82
  --- Node.java 17 Mar 2004 19:23:03 -  1.81
  +++ Node.java 7 Apr 2004 20:41:32 -   1.82
  @@ -303,7 +303,7 @@
   if( n instanceof NamedAttribute ) {
   result.add( n );
   }
  -else {
  +else if (! (n instanceof Comment)) {
   // Nothing can come before jsp:attribute, and only
   // jsp:body can come after it.
   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/runtime JspRuntimeLibrary.java

2004-03-30 Thread kinman
kinman  2004/03/30 11:18:43

  Modified:jasper2/src/share/org/apache/jasper/runtime
JspRuntimeLibrary.java
  Log:
  - Fix bugzilla 28058: JspRuntimeLibrary.getContextRelativePath() can throw
StringIndexOutOfBoundsException
  
  Revision  ChangesPath
  1.30  +4 -2  
jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/runtime/JspRuntimeLibrary.java
  
  Index: JspRuntimeLibrary.java
  ===
  RCS file: 
/home/cvs/jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/runtime/JspRuntimeLibrary.java,v
  retrieving revision 1.29
  retrieving revision 1.30
  diff -u -r1.29 -r1.30
  --- JspRuntimeLibrary.java17 Mar 2004 19:23:04 -  1.29
  +++ JspRuntimeLibrary.java30 Mar 2004 19:18:43 -  1.30
  @@ -916,12 +916,14 @@
   String pathInfo = (String)
   request.getAttribute(javax.servlet.include.path_info);
   if (pathInfo == null) {
  -uri = uri.substring(0, uri.lastIndexOf('/'));
  +if (uri.lastIndexOf('/') = 0) 
  +uri = uri.substring(0, uri.lastIndexOf('/'));
   }
   }
   else {
   uri = hrequest.getServletPath();
  -uri = uri.substring(0, uri.lastIndexOf('/'));
  +if (uri.lastIndexOf('/') = 0) 
  +uri = uri.substring(0, uri.lastIndexOf('/'));
   }
   return uri + '/' + relativePath;
   
  
  
  

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

2004-03-26 Thread kinman
kinman  2004/03/26 16:52:55

  Modified:jasper2/src/share/org/apache/jasper/compiler Generator.java
  Log:
  - Fix bugzilla 27665: Nested tags with scripting variables generates
invalid code
  
  Revision  ChangesPath
  1.230 +16 -0 
jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/compiler/Generator.java
  
  Index: Generator.java
  ===
  RCS file: 
/home/cvs/jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/compiler/Generator.java,v
  retrieving revision 1.229
  retrieving revision 1.230
  diff -u -r1.229 -r1.230
  --- Generator.java25 Mar 2004 21:53:12 -  1.229
  +++ Generator.java27 Mar 2004 00:52:55 -  1.230
  @@ -2468,6 +2468,10 @@
   for (int i = 0; i  varInfos.length; i++) {
   if (varInfos[i].getScope() != scope)
   continue;
  +// If the scripting variable has been declared, skip codes
  +// for saving and restoring it.
  +if (n.getScriptingVars(scope).contains(varInfos[i]))
  +continue;
   String varName = varInfos[i].getVarName();
   String tmpVarName =
   _jspx_ + varName + _ + n.getCustomNestingLevel();
  @@ -2480,6 +2484,10 @@
   for (int i = 0; i  tagVarInfos.length; i++) {
   if (tagVarInfos[i].getScope() != scope)
   continue;
  +// If the scripting variable has been declared, skip codes
  +// for saving and restoring it.
  +if (n.getScriptingVars(scope).contains(tagVarInfos[i]))
  +continue;
   String varName = tagVarInfos[i].getNameGiven();
   if (varName == null) {
   varName =
  @@ -2522,6 +2530,10 @@
   if (varInfos[i].getScope() != scope)
   continue;
   String varName = varInfos[i].getVarName();
  +// If the scripting variable has been declared, skip codes
  +// for saving and restoring it.
  +if (n.getScriptingVars(scope).contains(varInfos[i]))
  +continue;
   String tmpVarName =
   _jspx_ + varName + _ + n.getCustomNestingLevel();
   out.printin(varName);
  @@ -2532,6 +2544,10 @@
   } else {
   for (int i = 0; i  tagVarInfos.length; i++) {
   if (tagVarInfos[i].getScope() != scope)
  +continue;
  +// If the scripting variable has been declared, skip codes
  +// for saving and restoring it.
  +if (n.getScriptingVars(scope).contains(tagVarInfos[i]))
   continue;
   String varName = tagVarInfos[i].getNameGiven();
   if (varName == 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 Generator.java

2004-03-26 Thread kinman
kinman  2004/03/26 17:04:39

  Modified:jasper2/src/share/org/apache/jasper/compiler Tag:
tomcat_4_branch Generator.java
  Log:
  - Fix bugzilla 19361: Nested tags with scripting variables generates
invalid code
  
  Revision  ChangesPath
  No   revision
  No   revision
  1.35.2.23 +19 -3 
jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/compiler/Generator.java
  
  Index: Generator.java
  ===
  RCS file: 
/home/cvs/jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/compiler/Generator.java,v
  retrieving revision 1.35.2.22
  retrieving revision 1.35.2.23
  diff -u -r1.35.2.22 -r1.35.2.23
  --- Generator.java24 Mar 2004 21:31:07 -  1.35.2.22
  +++ Generator.java27 Mar 2004 01:04:39 -  1.35.2.23
  @@ -1582,6 +1582,10 @@
for (int i=0; ivarInfos.length; i++) {
if (varInfos[i].getScope() != scope)
continue;
  +// If the scripting variable has been declared, skip codes
  +// for saving and restoring it.
  +if (n.getScriptingVars(scope).contains(varInfos[i]))
  +continue;
String varName = varInfos[i].getVarName();
String tmpVarName = _jspx_ + varName + _
+ n.getCustomNestingLevel();
  @@ -1594,6 +1598,10 @@
for (int i=0; itagVarInfos.length; i++) {
if (tagVarInfos[i].getScope() != scope)
continue;
  +// If the scripting variable has been declared, skip codes
  +// for saving and restoring it.
  +if (n.getScriptingVars(scope).contains(tagVarInfos[i]))
  +continue;
String varName = tagVarInfos[i].getNameGiven();
if (varName == null) {
varName = n.getTagData().getAttributeString(
  @@ -1631,6 +1639,10 @@
for (int i=0; ivarInfos.length; i++) {
if (varInfos[i].getScope() != scope)
continue;
  +// If the scripting variable has been declared, skip codes
  +// for saving and restoring it.
  +if (n.getScriptingVars(scope).contains(varInfos[i]))
  +continue;
String varName = varInfos[i].getVarName();
String tmpVarName = _jspx_ + varName + _
+ n.getCustomNestingLevel();
  @@ -1643,6 +1655,10 @@
for (int i=0; itagVarInfos.length; i++) {
if (tagVarInfos[i].getScope() != scope)
continue;
  +// If the scripting variable has been declared, skip codes
  +// for saving and restoring it.
  +if (n.getScriptingVars(scope).contains(tagVarInfos[i]))
  +continue;
String varName = tagVarInfos[i].getNameGiven();
if (varName == null) {
varName = n.getTagData().getAttributeString(
  
  
  

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

2004-03-24 Thread kinman
kinman  2004/03/24 13:05:27

  Modified:jasper2/src/share/org/apache/jasper/compiler Generator.java
  Log:
  - FIx bugzilla 16830: bodyContent content not reset when a tag is reused.
  
  Revision  ChangesPath
  1.227 +7 -2  
jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/compiler/Generator.java
  
  Index: Generator.java
  ===
  RCS file: 
/home/cvs/jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/compiler/Generator.java,v
  retrieving revision 1.226
  retrieving revision 1.227
  diff -u -r1.226 -r1.227
  --- Generator.java23 Mar 2004 01:56:39 -  1.226
  +++ Generator.java24 Mar 2004 21:05:26 -  1.227
  @@ -231,7 +231,8 @@
   createTagHandlerPoolName(
   n.getPrefix(),
   n.getLocalName(),
  -n.getAttributes());
  +n.getAttributes(),
  +n.hasEmptyBody());
   n.setTagHandlerPoolName(name);
   if (!names.contains(name)) {
   names.add(name);
  @@ -249,7 +250,8 @@
   private String createTagHandlerPoolName(
   String prefix,
   String shortName,
  -Attributes attrs) {
  +Attributes attrs,
  +boolean hasEmptyBody) {
   String poolName = null;
   
   if (prefix.indexOf('-') = 0)
  @@ -274,6 +276,9 @@
   for (int i = 0; i  attrNames.length; i++) {
   poolName = poolName + _ + attrNames[i];
   }
  +}
  +if (hasEmptyBody) {
  +poolName = poolName + _nobody;
   }
   return poolName;
   }
  
  
  

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

2004-03-24 Thread kinman
kinman  2004/03/24 13:31:07

  Modified:jasper2/src/share/org/apache/jasper/compiler Tag:
tomcat_4_branch Generator.java
  Log:
  -Fix 16830: bodyContent content not reset when a tag is reused.
  
  Revision  ChangesPath
  No   revision
  No   revision
  1.35.2.22 +10 -5 
jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/compiler/Generator.java
  
  Index: Generator.java
  ===
  RCS file: 
/home/cvs/jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/compiler/Generator.java,v
  retrieving revision 1.35.2.21
  retrieving revision 1.35.2.22
  diff -u -r1.35.2.21 -r1.35.2.22
  --- Generator.java5 Feb 2004 22:19:07 -   1.35.2.21
  +++ Generator.java24 Mar 2004 21:31:07 -  1.35.2.22
  @@ -195,7 +195,8 @@

String name = createTagHandlerPoolName(n.getPrefix(),
   n.getShortName(),
  -n.getAttributes());
  +n.getAttributes(),
  +   n.getBody() == null);
n.setTagHandlerPoolName(name);
if (!names.contains(name)) {
names.add(name);
  @@ -212,7 +213,8 @@
 */
private String createTagHandlerPoolName(String prefix,
String shortName,
  - Attributes attrs) {
  + Attributes attrs,
  +boolean hasEmptyBody) {
String poolName = null;
   
if (prefix.indexOf('-') = 0)
  @@ -238,6 +240,9 @@
poolName = poolName + _ + attrNames[i];
}
}
  +if (hasEmptyBody) {
  +poolName = poolName + _nobody;
  +}
return poolName;
}
}
  
  
  

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

2004-03-22 Thread kinman
kinman  2004/03/22 16:06:07

  Modified:jasper2/src/share/org/apache/jasper/compiler Generator.java
  Log:
  - Fix bugzilla 27830: undefined EL variable in unterpreted text (XML syntax)
causes null (instead of)  to be generated.
  
  Revision  ChangesPath
  1.225 +1 -1  
jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/compiler/Generator.java
  
  Index: Generator.java
  ===
  RCS file: 
/home/cvs/jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/compiler/Generator.java,v
  retrieving revision 1.224
  retrieving revision 1.225
  diff -u -r1.224 -r1.225
  --- Generator.java17 Mar 2004 19:23:03 -  1.224
  +++ Generator.java23 Mar 2004 00:06:07 -  1.225
  @@ -1747,7 +1747,7 @@
   out.print(=);
   if (jspAttrs[i].isELInterpreterInput()) {
   out.print( + );
  -out.print(attributeValue(jspAttrs[i], false, Object.class));
  +out.print(attributeValue(jspAttrs[i], false, String.class));
   out.print( + );
   } else {
   String quote = DOUBLE_QUOTE;
  
  
  

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



cvs commit: jakarta-tomcat-connectors/coyote build.xml

2004-03-16 Thread kinman
kinman  2004/03/16 11:48:39

  Modified:coyote   build.xml
  Log:
  - Fix the build
  
  Revision  ChangesPath
  1.28  +2 -2  jakarta-tomcat-connectors/coyote/build.xml
  
  Index: build.xml
  ===
  RCS file: /home/cvs/jakarta-tomcat-connectors/coyote/build.xml,v
  retrieving revision 1.27
  retrieving revision 1.28
  diff -u -r1.27 -r1.28
  --- build.xml 10 Mar 2004 22:35:10 -  1.27
  +++ build.xml 16 Mar 2004 19:48:38 -  1.28
  @@ -228,7 +228,7 @@
   /copy
 /target
   
  -  target name=jar.tomcat5 depends=compile.shared,compile.tomcat5 
  +  target name=jar.tomcat5 depends=static,compile.shared,compile.tomcat5 
   jar  jarfile=${tomcat-coyote.jar}
index=true
basedir=${build.home}/classes
  
  
  

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



cvs commit: jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/servlet JspServletWrapper.java

2004-03-09 Thread kinman
kinman  2004/03/09 09:53:37

  Modified:jasper2/src/share/org/apache/jasper/servlet Tag:
tomcat_4_branch JspServletWrapper.java
  Log:
  - Patch by Torsten Fohrer
Fix for bug 16113: removing then replacing a jsp page continues to give a 404
  
  Revision  ChangesPath
  No   revision
  No   revision
  1.6.2.6   +4 -3  
jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/servlet/JspServletWrapper.java
  
  Index: JspServletWrapper.java
  ===
  RCS file: 
/home/cvs/jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/servlet/JspServletWrapper.java,v
  retrieving revision 1.6.2.5
  retrieving revision 1.6.2.6
  diff -u -r1.6.2.5 -r1.6.2.6
  --- JspServletWrapper.java5 Feb 2004 22:19:08 -   1.6.2.5
  +++ JspServletWrapper.java9 Mar 2004 17:53:37 -   1.6.2.6
  @@ -225,6 +225,7 @@
ex.getMessage());
   }
   } catch (FileNotFoundException ex) {
  +ctxt.incrementRemoved();
   String includeRequestUri = (String)
   request.getAttribute(javax.servlet.include.request_uri);
   if (includeRequestUri != 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 Compiler.java Generator.java Node.java SmapUtil.java

2004-03-08 Thread kinman
kinman  2004/03/08 13:28:30

  Modified:jasper2/src/share/org/apache/jasper/compiler Compiler.java
Generator.java Node.java SmapUtil.java
  Log:
  - Currently, smap for inner classes are not generated to the correct class
files.  For inner class defined in servlet codes, there is nothing Jasper
can do, since the servlet codes are not parsed.  However, for inner classes
generated by Jasper, such as the helper classes for handling fragments,
the following changes are made to fix this problem:
  
- Add a field in Node to indicate the name of a inner class.  This field
  is set in Generator, and accessed in SmapUtil.
- In SmapUtil.generateSamp(), when scanning the page nodes, if the codes
  are meant for a inner class, the smap is generated to a buffer.  It
  now returns an array, pairing the class file names with their corresponding
  smaps.
- SmapUtil.installSmap() takes the array as an augment, and install the
  smaps into the corresponding class files.
  
  Revision  ChangesPath
  1.78  +5 -5  
jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/compiler/Compiler.java
  
  Index: Compiler.java
  ===
  RCS file: 
/home/cvs/jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/compiler/Compiler.java,v
  retrieving revision 1.77
  retrieving revision 1.78
  diff -u -r1.77 -r1.78
  --- Compiler.java 23 Jan 2004 01:50:08 -  1.77
  +++ Compiler.java 8 Mar 2004 21:28:28 -   1.78
  @@ -186,10 +186,10 @@
* @return a smap for the current JSP page, if one is generated,
* null otherwise
*/
  -private String generateJava()
  +private String[] generateJava()
   throws Exception
   {
  - String smapStr = null;
  + String[] smapStr = null;
   
   long t1=System.currentTimeMillis();
   
  @@ -306,7 +306,7 @@
   /** 
* Compile the servlet from .java file to .class file
*/
  -private void generateClass(String smap)
  +private void generateClass(String[] smap)
   throws FileNotFoundException, JasperException, Exception {
   
   long t1=System.currentTimeMillis();
  @@ -426,7 +426,7 @@
   
   // JSR45 Support
   if (! options.isSmapSuppressed()) {
  -SmapUtil.installSmap(ctxt.getClassFileName(), smap);
  +SmapUtil.installSmap(smap);
   }
   }
   
  @@ -453,7 +453,7 @@
   }
   
   try {
  -String smap = generateJava();
  +String[] smap = generateJava();
   if (compileClass) {
   generateClass(smap);
   }
  
  
  
  1.223 +6 -3  
jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/compiler/Generator.java
  
  Index: Generator.java
  ===
  RCS file: 
/home/cvs/jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/compiler/Generator.java,v
  retrieving revision 1.222
  retrieving revision 1.223
  diff -u -r1.222 -r1.223
  --- Generator.java2 Mar 2004 19:39:12 -   1.222
  +++ Generator.java8 Mar 2004 21:28:28 -   1.223
  @@ -94,6 +94,8 @@
* @author Mandar Raje
* @author Rajiv Mordani
* @author Pierre Delisle
  + *
  + * Tomcat 4.1.x and Tomcat 5:
* @author Kin-man Chung
* @author Jan Luehe
* @author Shawn Bayern
  @@ -3913,6 +3915,7 @@
   Fragment result = new Fragment(fragments.size(), parent);
   fragments.add(result);
   this.used = true;
  +parent.setInnerClassName(className);
   
   ServletWriter out = result.getGenBuffer().getOut();
   out.pushIndent();
  
  
  
  1.80  +18 -3 
jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/compiler/Node.java
  
  Index: Node.java
  ===
  RCS file: 
/home/cvs/jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/compiler/Node.java,v
  retrieving revision 1.79
  retrieving revision 1.80
  diff -u -r1.79 -r1.80
  --- Node.java 1 Mar 2004 22:51:34 -   1.79
  +++ Node.java 8 Mar 2004 21:28:29 -   1.80
  @@ -116,6 +116,13 @@
   protected Nodes namedAttributeNodes; // cached for performance
   protected String qName;
   protected String localName;
  +/*
  + * The name of the inner class to which the codes for this node and
  + * its body are generated.  For instance, for jsp:body in foo.jsp,
  + * this is foo_jspHelper.  This is primarily used for communicating
  + * such info from Generator to Smap generator.
  + */
  +protected String innerClassName;
   
   private boolean isDummy;
   
  @@ -398,6 +405,14 @@
n = n.getParent();
}
return (Node.Root) n;
  +}
  +
  +public String

cvs commit: jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/servlet JspServletWrapper.java

2004-03-08 Thread kinman
kinman  2004/03/08 16:47:10

  Modified:jasper2/src/share/org/apache/jasper/servlet
JspServletWrapper.java
  Log:
  Patch by Torsten Fohrer [EMAIL PROTECTED]
  
  - Fix Bugzilla 16113: removing then replacing a jsp page continues to give
a 404.
  
  Revision  ChangesPath
  1.32  +4 -3  
jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/servlet/JspServletWrapper.java
  
  Index: JspServletWrapper.java
  ===
  RCS file: 
/home/cvs/jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/servlet/JspServletWrapper.java,v
  retrieving revision 1.31
  retrieving revision 1.32
  diff -u -r1.31 -r1.32
  --- JspServletWrapper.java2 Sep 2003 21:39:59 -   1.31
  +++ JspServletWrapper.java9 Mar 2004 00:47:10 -   1.32
  @@ -331,6 +331,7 @@
ex.getMessage());
   }
   } catch (FileNotFoundException ex) {
  +ctxt.incrementRemoved();
   String includeRequestUri = (String)
   request.getAttribute(javax.servlet.include.request_uri);
   if (includeRequestUri != 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/runtime JspRuntimeLibrary.java

2004-03-04 Thread kinman
kinman  2004/03/04 16:44:03

  Modified:jasper2/src/share/org/apache/jasper/runtime
JspRuntimeLibrary.java
  Log:
  - When a.jsp jsp:includes b.jsp that jsp:includes c.jsp, the context
relative path for c.jsp is computed incorrectly.
  
  Revision  ChangesPath
  1.27  +7 -6  
jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/runtime/JspRuntimeLibrary.java
  
  Index: JspRuntimeLibrary.java
  ===
  RCS file: 
/home/cvs/jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/runtime/JspRuntimeLibrary.java,v
  retrieving revision 1.26
  retrieving revision 1.27
  diff -u -r1.26 -r1.27
  --- JspRuntimeLibrary.java5 Feb 2004 22:16:47 -   1.26
  +++ JspRuntimeLibrary.java5 Mar 2004 00:44:03 -   1.27
  @@ -958,10 +958,11 @@
   HttpServletRequest hrequest = (HttpServletRequest) request;
   String uri = (String)
   request.getAttribute(javax.servlet.include.servlet_path);
  -if (uri == null)
  -uri = hrequest.getServletPath();
  +if (uri != null) {
  +return uri + '/' + relativePath;
  +}
  +uri = hrequest.getServletPath();
   return (uri.substring(0, uri.lastIndexOf('/')) + '/' + relativePath);
  -
   
   }
   
  
  
  

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



cvs commit: jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/runtime JspRuntimeLibrary.java

2004-03-04 Thread kinman
kinman  2004/03/04 18:02:46

  Modified:jasper2/src/share/org/apache/jasper/runtime
JspRuntimeLibrary.java
  Log:
  - The last patch is not quite right: it only works if the path info is non-null.
  
  Revision  ChangesPath
  1.28  +13 -6 
jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/runtime/JspRuntimeLibrary.java
  
  Index: JspRuntimeLibrary.java
  ===
  RCS file: 
/home/cvs/jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/runtime/JspRuntimeLibrary.java,v
  retrieving revision 1.27
  retrieving revision 1.28
  diff -u -r1.27 -r1.28
  --- JspRuntimeLibrary.java5 Mar 2004 00:44:03 -   1.27
  +++ JspRuntimeLibrary.java5 Mar 2004 02:02:46 -   1.28
  @@ -959,10 +959,17 @@
   String uri = (String)
   request.getAttribute(javax.servlet.include.servlet_path);
   if (uri != null) {
  -return uri + '/' + relativePath;
  +String pathInfo = (String)
  +request.getAttribute(javax.servlet.include.path_info);
  +if (pathInfo == null) {
  +uri = uri.substring(0, uri.lastIndexOf('/'));
  +}
   }
  -uri = hrequest.getServletPath();
  -return (uri.substring(0, uri.lastIndexOf('/')) + '/' + relativePath);
  +else {
  +uri = hrequest.getServletPath();
  +uri = uri.substring(0, uri.lastIndexOf('/'));
  +}
  +return uri + '/' + relativePath;
   
   }
   
  
  
  

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

2004-03-02 Thread kinman
kinman  2004/03/02 11:39:13

  Modified:jasper2/src/share/org/apache/jasper/compiler Generator.java
  Log:
  - Annotate several node types with missing Java line information.  This
also fixes bugzilla 27368: missing smap for UninterpretedTag nodes.
  
  Revision  ChangesPath
  1.222 +19 -3 
jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/compiler/Generator.java
  
  Index: Generator.java
  ===
  RCS file: 
/home/cvs/jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/compiler/Generator.java,v
  retrieving revision 1.221
  retrieving revision 1.222
  diff -u -r1.221 -r1.222
  --- Generator.java1 Mar 2004 21:09:21 -   1.221
  +++ Generator.java2 Mar 2004 19:39:12 -   1.222
  @@ -1756,6 +1756,8 @@
   
   public void visit(Node.UninterpretedTag n) throws JasperException {
   
  +n.setBeginJavaLine(out.getJavaLine());
  +
   /*
* Write begin tag
*/
  @@ -1816,10 +1818,14 @@
   } else {
   out.println(/\););
   }
  +
  +n.setEndJavaLine(out.getJavaLine());
   }
   
   public void visit(Node.JspElement n) throws JasperException {
   
  +n.setBeginJavaLine(out.getJavaLine());
  +
   // Compute attribute value string for XML-style and named
   // attributes
   Hashtable map = new Hashtable();
  @@ -1882,6 +1888,8 @@
   } else {
   out.println( + \/\););
   }
  +
  +n.setEndJavaLine(out.getJavaLine());
   }
   
   public void visit(Node.TemplateText n) throws JasperException {
  @@ -2007,6 +2015,8 @@
   
   public void visit(Node.InvokeAction n) throws JasperException {
   
  +n.setBeginJavaLine(out.getJavaLine());
  +
   // Copy virtual page scope of tag file to page scope of invoking
   // page
   out.printil(
  @@ -2041,10 +2051,14 @@
   }
   out.println(););
   }
  +
  +n.setEndJavaLine(out.getJavaLine());
   }
   
   public void visit(Node.DoBodyAction n) throws JasperException {
   
  +n.setBeginJavaLine(out.getJavaLine());
  +
   // Copy virtual page scope of tag file to page scope of invoking
   // page
   out.printil(
  @@ -2081,6 +2095,8 @@
   }
   out.println(););
   }
  +
  +n.setEndJavaLine(out.getJavaLine());
   }
   
   public void visit(Node.AttributeGenerator n) throws JasperException {
  
  
  

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

2004-03-01 Thread kinman
kinman  2004/03/01 13:09:21

  Modified:jasper2/src/share/org/apache/jasper/compiler Generator.java
  Log:
  - Fix bugzilla 27330: pageContext not defined in the body of nest tags.
  
  Revision  ChangesPath
  1.221 +6 -3  
jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/compiler/Generator.java
  
  Index: Generator.java
  ===
  RCS file: 
/home/cvs/jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/compiler/Generator.java,v
  retrieving revision 1.220
  retrieving revision 1.221
  diff -u -r1.220 -r1.221
  --- Generator.java18 Feb 2004 21:30:54 -  1.220
  +++ Generator.java1 Mar 2004 21:09:21 -   1.221
  @@ -1685,6 +1685,9 @@
   out.pushIndent();
   
   // Initilaize local variables used in this method.
  +if (! isTagFile) {
  +out.printil(PageContext pageContext = _jspx_page_context;);
  +}
   out.printil(JspWriter out = _jspx_page_context.getOut(););
   generateLocalVariables(out, n);
   }
  
  
  

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

2004-03-01 Thread kinman
kinman  2004/03/01 14:51:34

  Modified:jasper2/src/share/org/apache/jasper/compiler Node.java
  Log:
  - Fix 27338: Wrong Smap line for CDATA in scriptlets in .jspx pages.
  
  Revision  ChangesPath
  1.79  +15 -3 
jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/compiler/Node.java
  
  Index: Node.java
  ===
  RCS file: 
/home/cvs/jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/compiler/Node.java,v
  retrieving revision 1.78
  retrieving revision 1.79
  diff -u -r1.78 -r1.79
  --- Node.java 28 Oct 2003 23:04:11 -  1.78
  +++ Node.java 1 Mar 2004 22:51:34 -   1.79
  @@ -829,6 +829,18 @@
}
return ret;
}
  +
  +/**
  + * For the same reason as above, the source line information in the
  + * contained TemplateText node should be used.
  + */
  +public Mark getStart() {
  +if (text == null  body != null  body.size()  0) {
  +return body.getNode(0).getStart();
  +} else {
  +return super.getStart();
  +}
  +}
   }
   
   /**
  
  
  

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

2004-02-27 Thread kinman
kinman  2004/02/27 10:54:34

  Modified:jasper2/src/share/org/apache/jasper/compiler
TextOptimizer.java
  Log:
  - Fix bugzilla 27300: Wrong Smap when jsp comments are present
  
  Revision  ChangesPath
  1.3   +3 -6  
jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/compiler/TextOptimizer.java
  
  Index: TextOptimizer.java
  ===
  RCS file: 
/home/cvs/jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/compiler/TextOptimizer.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- TextOptimizer.java10 Nov 2003 22:26:20 -  1.2
  +++ TextOptimizer.java27 Feb 2004 18:54:34 -  1.3
  @@ -105,9 +105,6 @@
   public void visit(Node.VariableDirective n) throws JasperException {
   }
   
  -public void visit(Node.Comment n) throws JasperException {
  -}
  -
   /*
* Don't concatenate text across body boundaries
*/
  
  
  

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



cvs commit: jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/resources messages.properties

2004-02-25 Thread kinman
kinman  2004/02/25 16:19:02

  Modified:jasper2/src/share/org/apache/jasper/compiler PageInfo.java
Parser.java
   jasper2/src/share/org/apache/jasper/resources
messages.properties
  Log:
  - According to the spec, it is a fatal error for the taglib directive to
appear after actions using the prefix introduced by it.
  
  Revision  ChangesPath
  1.40  +13 -3 
jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/compiler/PageInfo.java
  
  Index: PageInfo.java
  ===
  RCS file: 
/home/cvs/jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/compiler/PageInfo.java,v
  retrieving revision 1.39
  retrieving revision 1.40
  diff -u -r1.39 -r1.40
  --- PageInfo.java 14 Aug 2003 21:16:52 -  1.39
  +++ PageInfo.java 26 Feb 2004 00:19:01 -  1.40
  @@ -81,6 +81,7 @@
   private HashMap taglibsMap;
   private HashMap jspPrefixMapper;
   private HashMap xmlPrefixMapper;
  +private HashMap nonCustomTagPrefixMap;
   private String defaultLanguage = java;
   private String language;
   private String defaultExtends = Constants.JSP_SERVLET_BASE;
  @@ -125,6 +126,7 @@
this.taglibsMap = new HashMap();
this.jspPrefixMapper = new HashMap();
this.xmlPrefixMapper = new HashMap();
  +this.nonCustomTagPrefixMap = new HashMap();
this.imports = new Vector();
   this.dependants = new Vector();
this.includePrelude = new Vector();
  @@ -656,5 +658,13 @@
   
   public boolean isELIgnored() {
return isELIgnored;
  +}
  +
  +public void putNonCustomTagPrefix(String prefix, Mark where) {
  +nonCustomTagPrefixMap.put(prefix, where);
  +}
  +
  +public Mark getNonCustomTagPrefix(String prefix) {
  +return (Mark) nonCustomTagPrefixMap.get(prefix);
   }
   }
  
  
  
  1.88  +10 -3 
jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/compiler/Parser.java
  
  Index: Parser.java
  ===
  RCS file: 
/home/cvs/jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/compiler/Parser.java,v
  retrieving revision 1.87
  retrieving revision 1.88
  diff -u -r1.87 -r1.88
  --- Parser.java   15 Dec 2003 19:24:20 -  1.87
  +++ Parser.java   26 Feb 2004 00:19:01 -  1.88
  @@ -447,6 +447,11 @@
String uri = attrs.getValue(uri);
String prefix = attrs.getValue(prefix);
if (prefix != null) {
  +Mark prevMark = pageInfo.getNonCustomTagPrefix(prefix);
  +if (prevMark != null) {
  +err.jspError(reader.mark(), jsp.error.prefix.use_before_dcl,
  +prefix, prevMark.getFile(),  + prevMark.getLineNumber());
  +}
if (uri != null) {
String uriPrev = pageInfo.getURI(prefix);
if (uriPrev != null  !uriPrev.equals(uri)) {
  @@ -1336,6 +1341,8 @@
String uri = pageInfo.getURI(prefix);
   if (uri == null) {
reader.reset(start);
  +// Remember the prefix for later error checking
  +pageInfo.putNonCustomTagPrefix(prefix, reader.mark());
return false;
}
   
  
  
  
  1.141 +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.140
  retrieving revision 1.141
  diff -u -r1.140 -r1.141
  --- messages.properties   18 Feb 2004 21:22:21 -  1.140
  +++ messages.properties   26 Feb 2004 00:19:01 -  1.141
  @@ -405,3 +405,4 @@
   jsp.error.nested_jsproot=Nested lt;jsp:rootgt;
   jsp.error.unbalanced.endtag=The end tag \lt;/{0}\ is unbalanced
   jsp.error.invalid.bean=The value for the useBean class attribute {0} is invalid.
  +jsp.error.prefix.use_before_dcl=The prefix {0} specified in this tag directive has 
been previously used by an action in file {1} line {2}.
  
  
  

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



cvs commit: jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/resources messages.properties messages_es.properties messages_fr.properties messages_ja.properties

2004-02-18 Thread kinman
kinman  2004/02/18 13:22:22

  Modified:jasper2/src/share/org/apache/jasper
EmbeddedServletOptions.java JspC.java Options.java
   jasper2/src/share/org/apache/jasper/compiler Generator.java
   jasper2/src/share/org/apache/jasper/resources
messages.properties messages_es.properties
messages_fr.properties messages_ja.properties
  Log:
  - Add some intellignece to the compiler for generating code for useBean action.
Generate direct instantiation (use new) when possible, use bean.instantiate
when bean name is specified, and for the case of invalid bean class, either
issue a translation time error (instead of javac error), or generate codes
to throw InstantiationException at runtime, depending on a new compiler
switch, errorOnUseBeanInvalidClassAttribute(defaulted to true).  ;_)
  
  Revision  ChangesPath
  1.9   +26 -3 
jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/EmbeddedServletOptions.java
  
  Index: EmbeddedServletOptions.java
  ===
  RCS file: 
/home/cvs/jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/EmbeddedServletOptions.java,v
  retrieving revision 1.8
  retrieving revision 1.9
  diff -u -r1.8 -r1.9
  --- EmbeddedServletOptions.java   19 Dec 2003 18:15:51 -  1.8
  +++ EmbeddedServletOptions.java   18 Feb 2004 21:22:21 -  1.9
  @@ -158,6 +158,8 @@
*/
   private boolean genStringAsCharArray = false;
   
  +private boolean errorOnUseBeanInvalidClassAttribute = true;
  +
   /**
* I want to see my generated servlets. Which directory are they
* in?
  @@ -334,6 +336,13 @@
   return compiler;
   }
   
  +public boolean getErrorOnUseBeanInvalidClassAttribute() {
  +return errorOnUseBeanInvalidClassAttribute;
  +}
  +
  +public void setErrorOnUseBeanInvalidClassAttribute(boolean b) {
  +errorOnUseBeanInvalidClassAttribute = b;
  +}
   
   public TldLocationsCache getTldLocationsCache() {
return tldLocationsCache;
  @@ -535,6 +544,20 @@
   } else {
   if (log.isWarnEnabled()) {
   log.warn(Localizer.getMessage(jsp.warning.genchararray));
  +}
  +}
  +}
  +
  +String errBeanClass =
  + config.getInitParameter(errorOnUseBeanInvalidClassAttribute);
  +if (errBeanClass != null) {
  +if (errBeanClass.equalsIgnoreCase(true)) {
  +errorOnUseBeanInvalidClassAttribute = true;
  +} else if (errBeanClass.equalsIgnoreCase(false)) {
  +errorOnUseBeanInvalidClassAttribute = false;
  +} else {
  +if (log.isWarnEnabled()) {
  +log.warn(Localizer.getMessage(jsp.warning.errBean));
   }
   }
   }
  
  
  
  1.65  +12 -3 
jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/JspC.java
  
  Index: JspC.java
  ===
  RCS file: 
/home/cvs/jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/JspC.java,v
  retrieving revision 1.64
  retrieving revision 1.65
  diff -u -r1.64 -r1.65
  --- JspC.java 21 Jan 2004 15:45:31 -  1.64
  +++ JspC.java 18 Feb 2004 21:22:21 -  1.65
  @@ -186,6 +186,7 @@
   private boolean classDebugInfo = true;
   private Vector extensions;
   private Vector pages = new Vector();
  +private boolean errorOnUseBeanInvalidClassAttribute = true;
   
   /**
* The java file encoding.  Default
  @@ -342,6 +343,14 @@
   
   public boolean isXpoweredBy() {
   return xpoweredBy;
  +}
  +
  +public boolean getErrorOnUseBeanInvalidClassAttribute() {
  +return errorOnUseBeanInvalidClassAttribute;
  +}
  +
  +public void setErrorOnUseBeanInvalidClassAttribute(boolean b) {
  +errorOnUseBeanInvalidClassAttribute = b;
   }
   
   public int getTagPoolSize() {
  
  
  
  1.22  +10 -3 
jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/Options.java
  
  Index: Options.java
  ===
  RCS file: 
/home/cvs/jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/Options.java,v
  retrieving revision 1.21
  retrieving revision 1.22
  diff -u -r1.21 -r1.22
  --- Options.java  5 Feb 2004 23:02:18 -   1.21
  +++ Options.java  18 Feb 2004 21:22:21 -  1.22
  @@ -77,6 +77,13 @@
   public interface Options {
   
   /**
  + * Returns true if Jasper issues a compilation error instead of a runtime
  + * Instantiation error if the class attribute specified in useBean action
  + * is invalid.
  + */
  +public boolean getErrorOnUseBeanInvalidClassAttribute

cvs commit: jakarta-tomcat-catalina/catalina/src/conf web.xml

2004-02-18 Thread kinman
kinman  2004/02/18 13:24:45

  Modified:catalina/src/conf web.xml
  Log:
  - Document the new Jasper switch errorOnUseBeanInvalidClassAttribute
  
  Revision  ChangesPath
  1.35  +5 -0  jakarta-tomcat-catalina/catalina/src/conf/web.xml
  
  Index: web.xml
  ===
  RCS file: /home/cvs/jakarta-tomcat-catalina/catalina/src/conf/web.xml,v
  retrieving revision 1.34
  retrieving revision 1.35
  diff -u -r1.34 -r1.35
  --- web.xml   5 Feb 2004 19:49:33 -   1.34
  +++ web.xml   18 Feb 2004 21:24:45 -  1.35
  @@ -164,6 +164,11 @@
 !--   arrays, to improve performance in some cases?  --
 !--   [false]--
 !--  --
  +  !--   errorOnUseBeanInvalidClassAttribute--
  +  !--   Should Jasper issue an error when the value of --
  +  !--   the class attribute in an useBean action is--
  +  !--   not a valid bean class?  [true]--
  +  !--  --
 !--   scratchdir  What scratch directory should we use when  --
 !--   compiling JSP pages?  [default work directory  --
 !--   for the current web application]   --
  
  
  

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

2004-02-18 Thread kinman
kinman  2004/02/18 13:30:54

  Modified:jasper2/src/share/org/apache/jasper/compiler Generator.java
  Log:
  - Remove Sun copyright.
  
  Revision  ChangesPath
  1.220 +3 -8  
jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/compiler/Generator.java
  
  Index: Generator.java
  ===
  RCS file: 
/home/cvs/jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/compiler/Generator.java,v
  retrieving revision 1.219
  retrieving revision 1.220
  diff -u -r1.219 -r1.220
  --- Generator.java18 Feb 2004 21:22:21 -  1.219
  +++ Generator.java18 Feb 2004 21:30:54 -  1.220
  @@ -1,9 +1,4 @@
   /*
  - * Copyright 2004 Sun Microsystems, Inc. All rights reserved.
  - * SUN PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
  - */
  -
  -/*
* $Header$
* $Revision$
* $Date$
  
  
  

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

2004-02-09 Thread kinman
kinman  2004/02/09 15:12:57

  Modified:jasper2/src/share/org/apache/jasper/compiler
ParserController.java
  Log:
  - Fix bugzilla 26796: %@ include % fails when tag files are referenced in
a tag directives.
  
  Revision  ChangesPath
  1.50  +20 -15
jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/compiler/ParserController.java
  
  Index: ParserController.java
  ===
  RCS file: 
/home/cvs/jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/compiler/ParserController.java,v
  retrieving revision 1.49
  retrieving revision 1.50
  diff -u -r1.49 -r1.50
  --- ParserController.java 3 Jan 2004 12:12:21 -   1.49
  +++ ParserController.java 9 Feb 2004 23:12:57 -   1.50
  @@ -134,8 +134,9 @@
// (using an include directive), ctxt.getTagFileJar() returns the 
// JAR file from which to read the tag file or included resource,
// respectively.
  - return parse(inFileName, null, ctxt.isTagFile(), false,
  - ctxt.getTagFileJarUrl());
  +isTagFile = ctxt.isTagFile();
  +directiveOnly = false;
  +return doParse(inFileName, null, ctxt.getTagFileJarUrl());
   }
   
   /**
  @@ -149,8 +150,9 @@
   public Node.Nodes parse(String inFileName, Node parent,
URL jarFileUrl)
throws FileNotFoundException, JasperException, IOException {
  -// For files statically included, keep isTagfile and directiveOnly
  - return parse(inFileName, parent, isTagFile, directiveOnly, jarFileUrl);
  +// For files that are statically included, isTagfile and directiveOnly
  +// remain unchanged.
  +return doParse(inFileName, parent, jarFileUrl);
   }
   
   /**
  @@ -163,8 +165,15 @@
*/
   public Node.Nodes parseTagFileDirectives(String inFileName)
throws FileNotFoundException, JasperException, IOException {
  - return parse(inFileName, null, true, true,
  -  (URL) ctxt.getTagFileJarUrls().get(inFileName));
  +boolean isTagFileSave = isTagFile;
  +boolean directiveOnlySave = directiveOnly;
  +isTagFile = true;
  +directiveOnly = true;
  +Node.Nodes page = doParse(inFileName, null,
  + (URL) ctxt.getTagFileJarUrls().get(inFileName));
  +directiveOnly = directiveOnlySave;
  +isTagFile = isTagFileSave;
  +return page;
   }
   
   /**
  @@ -181,18 +190,14 @@
* @param jarFile The JAR file from which to read the JSP page or tag file,
* or null if the JSP page or tag file is to be read from the filesystem
*/
  -private Node.Nodes parse(String inFileName,
  -  Node parent,
  -  boolean isTagFile,
  -  boolean directivesOnly,
  -  URL jarFileUrl)
  +private Node.Nodes doParse(String inFileName,
  +   Node parent,
  +   URL jarFileUrl)
throws FileNotFoundException, JasperException, IOException {
   
Node.Nodes parsedPage = null;
isEncodingSpecifiedInProlog = false;
isDefaultPageEncoding = false;
  -this.isTagFile = isTagFile;
  -this.directiveOnly = directivesOnly;
   
JarFile jarFile = getJarFile(jarFileUrl);
String absFileName = resolveFileName(inFileName);
  @@ -229,7 +234,7 @@
try {
parsedPage = JspDocumentParser.parse(this, absFileName,
 jarFile, parent,
  -  isTagFile, directivesOnly,
  +  isTagFile, directiveOnly,
 sourceEnc,
 jspConfigPageEnc,
 isEncodingSpecifiedInProlog);
  @@ -251,7 +256,7 @@
sourceEnc, inStreamReader,
err);
   parsedPage = Parser.parse(this, jspReader, parent, isTagFile,
  -   directivesOnly, jarFileUrl,
  +   directiveOnly, jarFileUrl,
  sourceEnc, jspConfigPageEnc,
  isDefaultPageEncoding);
   } finally {
  
  
  

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



cvs commit: jakarta-servletapi-5/jsr152/examples/tagplugin howto.html

2004-02-06 Thread kinman
kinman  2004/02/06 10:28:38

  Modified:jsr152/examples/tagplugin howto.html
  Log:
  Fix typo.
  
  Revision  ChangesPath
  1.2   +2 -2  jakarta-servletapi-5/jsr152/examples/tagplugin/howto.html
  
  Index: howto.html
  ===
  RCS file: /home/cvs/jakarta-servletapi-5/jsr152/examples/tagplugin/howto.html,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- howto.html5 Feb 2004 18:09:04 -   1.1
  +++ howto.html6 Feb 2004 18:28:38 -   1.2
  @@ -9,10 +9,10 @@
 li
   Implement the plugin class.p/
   This class, which implements 
  -ttorg.apache.jasper.compiler.tagplugin.Plugin/tt
  +ttorg.apache.jasper.compiler.tagplugin.TagPlugin/tt
   instructs Jasper what Java codes to generate in place of the tag
   handler calls.
  -See Javadoc for ttorg.apache.jasper.compiler.tagplugin.Plugin/tt
  +See Javadoc for ttorg.apache.jasper.compiler.tagplugin.TagPlugin/tt
   for details.
 /li
   
  
  
  

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



cvs commit: jakarta-servletapi-5/jsr152/examples/tagplugin - New directory

2004-02-05 Thread kinman
kinman  2004/02/05 10:04:20

  jakarta-servletapi-5/jsr152/examples/tagplugin - New directory

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



cvs commit: jakarta-servletapi-5/jsr152/examples/tagplugin choose.html choose.jsp foreach.html foreach.jsp howto.html if.html if.jsp notes.html

2004-02-05 Thread kinman
kinman  2004/02/05 10:09:04

  Modified:jsr152/examples index.html
  Added:   jsr152/examples/WEB-INF tagPlugins.xml
   jsr152/examples/tagplugin choose.html choose.jsp
foreach.html foreach.jsp howto.html if.html if.jsp
notes.html
  Log:
  - Add examples, introductory notes, and a brief how-to notes for tag plugins.
  
  Revision  ChangesPath
  1.5   +46 -0 jakarta-servletapi-5/jsr152/examples/index.html
  
  Index: index.html
  ===
  RCS file: /home/cvs/jakarta-servletapi-5/jsr152/examples/index.html,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- index.html1 May 2003 22:39:53 -   1.4
  +++ index.html5 Feb 2004 18:09:04 -   1.5
  @@ -308,5 +308,51 @@
   
   /table
   
  +br/
  +bufont size=+1Tag Plugins/font/u/bbr
  +table BORDER=0 CELLSPACING=5 WIDTH=85% 
  +
  +tr VALIGN=TOP
  +  tdIfnbsp;/td
  +  td VALIGN=TOP WIDTH=30%
  +a href=tagplugin/if.jspimg SRC=images/execute.gif HSPACE=4 BORDER=0  
  +align=TOP/a
  +a href=tagplugin/if.jspExecute/a
  +  /td
  +  td WIDTH=30%
  +a href=tagplugin/if.htmlimg SRC=images/code.gif HSPACE=4 BORDER=0 hei
  +ght=24 width=24 align=TOP/a
  +a href=tagplugin/if.htmlSource/a
  +  /td
  +/tr
  +
  +tr VALIGN=TOP
  +  tdForEachnbsp;/td
  +  td VALIGN=TOP WIDTH=30%
  +a href=tagplugin/foreach.jspimg SRC=images/execute.gif HSPACE=4 BORDER=0 
 
  +align=TOP/a
  +a href=tagplugin/foreach.jspExecute/a
  +  /td
  +  td WIDTH=30%
  +a href=tagplugin/foreach.htmlimg SRC=images/code.gif HSPACE=4 BORDER=0 
hei
  +ght=24 width=24 align=TOP/a
  +a href=tagplugin/foreach.htmlSource/a
  +  /td
  +/tr
  +
  +tr VALIGN=TOP
  +  tdChoosenbsp;/td
  +  td VALIGN=TOP WIDTH=30%
  +a href=tagplugin/choose.jspimg SRC=images/execute.gif HSPACE=4 BORDER=0  
align=TOP/a
  +a href=tagplugin/choose.jspExecute/a
  +  /td
  +  td WIDTH=30%
  +a href=tagplugin/choose.htmlimg SRC=images/code.gif HSPACE=4 BORDER=0 
height=24 width=24 align=TOP/a
  +a href=tagplugin/choose.htmlSource/a
  +  /td
  +/tr
  +
  +/table
  +
   /body
   /html
  
  
  
  1.1  jakarta-servletapi-5/jsr152/examples/WEB-INF/tagPlugins.xml
  
  Index: tagPlugins.xml
  ===
  tag-plugins
tag-plugin
  tag-classorg.apache.taglibs.standard.tag.rt.core.IfTag/tag-class
  plugin-classorg.apache.jasper.tagplugins.jstl.If/plugin-class
/tag-plugin
tag-plugin
  tag-classorg.apache.taglibs.standard.tag.common.core.ChooseTag/tag-class
  plugin-classorg.apache.jasper.tagplugins.jstl.Choose/plugin-class
/tag-plugin
tag-plugin
  tag-classorg.apache.taglibs.standard.tag.rt.core.WhenTag/tag-class
  plugin-classorg.apache.jasper.tagplugins.jstl.When/plugin-class
/tag-plugin
tag-plugin
  tag-classorg.apache.taglibs.standard.tag.common.core.OtherwiseTag/tag-class
  plugin-classorg.apache.jasper.tagplugins.jstl.Otherwise/plugin-class
/tag-plugin
tag-plugin
  tag-classorg.apache.taglibs.standard.tag.rt.core.ForEachTag/tag-class
  plugin-classorg.apache.jasper.tagplugins.jstl.ForEach/plugin-class
/tag-plugin
  /tag-plugins
  
  
  
  1.1  jakarta-servletapi-5/jsr152/examples/tagplugin/choose.html
  
  Index: choose.html
  ===
  html
  head
  titleView Source Code/title
  /head
  
  body bgcolor=#FF
  pfont color=#FF
a href=choose.jsp
  img src=../images/execute.gif align=right border=0/a
a href=../index.html
  img src=../images/return.gif width=24 height=24 align=right border=0
/a/font
  /p
  
  h3
a href=choose.jsp.htmlSource Code for choose.jspfont color=#FF//a
  /h3
  
  /body
  /html
  
  
  
  1.1  jakarta-servletapi-5/jsr152/examples/tagplugin/choose.jsp
  
  Index: choose.jsp
  ===
  html
head
  titleTag Examples - choose/title
/head
body
  h1Tag Plugin Examples - lt;c:choose/h1
  
  hr
  /br
  a href=notes.htmlPlugin Introductory Notesfont font color=#FF/
  a
  br/
  a href=howto.htmlBrief Instructions for Writing Pluginsfont color=#000
  0
  FF/a
  br/ br/
  hr
  
  font color=#00/
  /br
  
  %@ taglib uri=http://java.sun.com/jsp/jstl/core; prefix=c %
  
  c:forEach var=index begin=0 end=4
# ${index}: 
c:choose
c:when test=${index == 1}
One!/br
/c:when
c:when test=${index == 4}
Four!/br
/c:when
c:when test=${index == 3}
Three!/br
/c:when
c:otherwise
Huh?/br
/c:otherwise
/c:choose
  /c:forEach
/body
  /html 
  
  
  
  1.1

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

2004-01-26 Thread kinman
kinman  2004/01/26 17:20:22

  Modified:jasper2/src/share/org/apache/jasper/compiler JspConfig.java
  Log:
  - Fix 26432: Incorrect mapping for url pattern in jsp property group.
I also took the oppertunity to do some clear up and refactoring.
  
  Revision  ChangesPath
  1.14  +75 -67
jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/compiler/JspConfig.java
  
  Index: JspConfig.java
  ===
  RCS file: 
/home/cvs/jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/compiler/JspConfig.java,v
  retrieving revision 1.13
  retrieving revision 1.14
  diff -u -r1.13 -r1.14
  --- JspConfig.java2 Sep 2003 21:39:58 -   1.13
  +++ JspConfig.java27 Jan 2004 01:20:22 -  1.14
  @@ -184,7 +184,15 @@
extension = *;
} else if (file.startsWith(*.)) {
extension = file.substring(file.indexOf('.')+1);
  - } else {
  + }
  +
  + // The url patterns are reconstructed as the follwoing:
  + // path != null, extension == null:  / or /foo/bar.ext
  + // path == null, extension != null:  *.ext
  + // path != null, extension == *:   /foo/*
  + boolean isStar = *.equals(extension);
  + if ((path == null  (extension == null || isStar)) || 
  + (path != null  !isStar)) {
if (log.isWarnEnabled()) {
 
log.warn(Localizer.getMessage(jsp.warning.bad.urlpattern.propertygroup,
   urlPattern));
  @@ -220,6 +228,42 @@
   }
   
   /**
  + * Select the property group that has more restrictive url-pattern.
  + * In case of tie, select the first.
  + */
  +private JspPropertyGroup selectProperty(JspPropertyGroup prev,
  +JspPropertyGroup curr) {
  +if (prev == null) {
  +return curr;
  +}
  +if (prev.getExtension() == null) {
  +// exact match
  +return prev;
  +}
  +if (curr.getExtension() == null) {
  +// exact match
  +return curr;
  +}
  +String prevPath = prev.getPath();
  +String currPath = curr.getPath();
  +if (prevPath == null  currPath == null) {
  +// Both specifies a *.ext, keep the first one
  +return prev;
  +}
  +if (prevPath == null  currPath != null) {
  +return curr;
  +}
  +if (prevPath != null  currPath == null) {
  +return prev;
  +}
  +if (prevPath.length() = currPath.length()) {
  +return prev;
  +}
  +return curr;
  +}
  +
  +
  +/**
* Find a property that best matches the supplied resource.
* @param uri the resource supplied.
* @return a JspProperty indicating the best match, or some default.
  @@ -264,39 +308,15 @@
String path = jpg.getPath();

if (extension == null) {
  - 
// exact match pattern: /a/foo.jsp
if (!uri.equals(path)) {
// not matched;
continue;
}
  - 
  - // Add include-preludes and include-codas
  - if (jp.getIncludePrelude() != null) {
  - includePreludes.addAll(jp.getIncludePrelude());
  - }
  - if (jp.getIncludeCoda() != null) {
  - includeCodas.addAll(jp.getIncludeCoda());
  - }
  - 
  - // For other attributes, keep the best match.
  - if (jp.isXml() != null) {
  - isXmlMatch = jpg;
  - }
  - if (jp.isELIgnored() != null) {
  - elIgnoredMatch = jpg;
  - }
  - if (jp.isScriptingInvalid() != null) {
  - scriptingInvalidMatch = jpg;
  - }
  - if (jp.getPageEncoding() != null) {
  - pageEncodingMatch = jpg;
  - }
} else {
  - 
  - // Possible patterns are *, *.ext, /p/*, and /p/*.ext
  - 
  - if (path != null  !path.equals(uriPath)) {
  + // Matching patterns *.ext or /p/*
  + if (path != null  uriPath != null 
  + ! uriPath.startsWith(path)) {
// not matched
continue;
}
  @@ -305,42 +325,30 @@
// not matched
continue

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

2004-01-22 Thread kinman
kinman  2004/01/22 11:35:07

  Modified:jasper2/src/share/org/apache/jasper/compiler Compiler.java
  Log:
  - Fix 26276: Generated TLD inconsistent after tagfile changes.  Need to
remove compilation wrapper for tag files if its clients has been changed.
  
  Revision  ChangesPath
  1.76  +19 -16
jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/compiler/Compiler.java
  
  Index: Compiler.java
  ===
  RCS file: 
/home/cvs/jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/compiler/Compiler.java,v
  retrieving revision 1.75
  retrieving revision 1.76
  diff -u -r1.75 -r1.76
  --- Compiler.java 6 Jan 2004 19:42:39 -   1.75
  +++ Compiler.java 22 Jan 2004 19:35:07 -  1.76
  @@ -498,6 +498,7 @@
*/
   public boolean isOutDated(boolean checkClass) {
   
  +boolean outDated = false;
   String jsp = ctxt.getJspFile();
   
   long jspRealLastModified = 0;
  @@ -513,7 +514,7 @@
   return true;
   }
   
  -long targetLastModified;
  +long targetLastModified = 0;
   File targetFile;
   
   if( checkClass ) {
  @@ -523,29 +524,30 @@
   }
   
   if (!targetFile.exists()) {
  -return true;
  -}
  -
  -targetLastModified = targetFile.lastModified();
  -if (targetLastModified  jspRealLastModified) {
  -if( log.isDebugEnabled() )
  -log.debug(Compiler: outdated:  + targetFile +   + 
targetLastModified );
  -return true;
  +outDated = true;
  +} else {
  +targetLastModified = targetFile.lastModified();
  +if (targetLastModified  jspRealLastModified) {
  +if( log.isDebugEnabled() ) {
  +log.debug(Compiler: outdated:  + targetFile +   +
  +targetLastModified );
  +}
  +outDated = true;
  +}
   }
   
   // determine if source dependent files (e.g. includes using include
  - // directives) have been changed.
  +// directives) have been changed.
   if( jsw==null ) {
  -return false;
  +return outDated;
   }
   
   List depends = jsw.getDependants();
   if (depends == null) {
  -return false;
  +return outDated;
   }
   
   Iterator it = depends.iterator();
  -boolean outDated = false;
   while (it.hasNext()) {
   String include = (String)it.next();
   try {
  @@ -554,18 +556,19 @@
   //System.out.println(Compiler: outdated, no includeUri  + 
include );
   outDated = true;
   }
  -if (includeUrl.openConnection().getLastModified() 
  +if (!outDated  includeUrl.openConnection().getLastModified() 
   targetLastModified) {
   //System.out.println(Compiler: outdated, include old  + 
include );
   outDated = true;
  -// Remove any potential Wrappers for tag files
  -ctxt.getRuntimeContext().removeWrapper(include);
   }
  +// Remove any potential Wrappers for tag files
  +ctxt.getRuntimeContext().removeWrapper(include);
   } catch (Exception e) {
   e.printStackTrace();
   outDated = true;
   }
   }
  +
   return outDated;
   
   }
  
  
  

-
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 Compiler.java TagFileProcessor.java

2004-01-22 Thread kinman
kinman  2004/01/22 17:50:08

  Modified:jasper2/src/share/org/apache/jasper/compiler Compiler.java
TagFileProcessor.java
  Log:
  Fix 26335: Modification check for tagfiles does not work recursively.
  Get reliable dependency info from the tag instance.
  
  Revision  ChangesPath
  1.77  +4 -2  
jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/compiler/Compiler.java
  
  Index: Compiler.java
  ===
  RCS file: 
/home/cvs/jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/compiler/Compiler.java,v
  retrieving revision 1.76
  retrieving revision 1.77
  diff -u -r1.76 -r1.77
  --- Compiler.java 22 Jan 2004 19:35:07 -  1.76
  +++ Compiler.java 23 Jan 2004 01:50:08 -  1.77
  @@ -561,8 +561,10 @@
   //System.out.println(Compiler: outdated, include old  + 
include );
   outDated = true;
   }
  -// Remove any potential Wrappers for tag files
  -ctxt.getRuntimeContext().removeWrapper(include);
  +if (outDated) {
  +// Remove any potential Wrappers for tag files
  +ctxt.getRuntimeContext().removeWrapper(include);
  +}
   } catch (Exception e) {
   e.printStackTrace();
   outDated = true;
  
  
  
  1.56  +15 -9 
jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/compiler/TagFileProcessor.java
  
  Index: TagFileProcessor.java
  ===
  RCS file: 
/home/cvs/jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/compiler/TagFileProcessor.java,v
  retrieving revision 1.55
  retrieving revision 1.56
  diff -u -r1.55 -r1.56
  --- TagFileProcessor.java 10 Dec 2003 00:24:23 -  1.55
  +++ TagFileProcessor.java 23 Jan 2004 01:50:08 -  1.56
  @@ -81,6 +81,7 @@
   import org.apache.jasper.JasperException;
   import org.apache.jasper.JspCompilationContext;
   import org.apache.jasper.servlet.JspServletWrapper;
  +import org.apache.jasper.runtime.JspSourceDependent;
   
   /**
* 1. Processes and extracts the directive info in a tag file.
  @@ -556,14 +557,19 @@
   }
   
   // Add the dependants for this tag file to its parent's
  -// dependant list.
  -PageInfo pageInfo = wrapper.getJspEngineContext().getCompiler().
  -getPageInfo();
  -if (pageInfo != null) {
  -Iterator iter = pageInfo.getDependants().iterator();
  -if (iter.hasNext()) {
  -parentPageInfo.addDependant((String)iter.next());
  +// dependant list.  The only reliable dependency information
  +// can only be obtained from the tag instance.
  +try {
  +Object tagIns = tagClazz.newInstance();
  +if (tagIns instanceof JspSourceDependent) {
  +Iterator iter = 
  +((JspSourceDependent)tagIns).getDependants().iterator();
  +while (iter.hasNext()) {
  +parentPageInfo.addDependant((String)iter.next());
  +}
   }
  +} catch (Exception e) {
  +// ignore errors
   }
   
   return tagClazz;
  
  
  

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

2004-01-06 Thread kinman
kinman  2004/01/06 11:42:40

  Modified:jasper2/src/share/org/apache/jasper/compiler Compiler.java
  Log:
  - Fix 25787: Directives added to working tag files are not generated.
  
  Revision  ChangesPath
  1.75  +7 -4  
jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/compiler/Compiler.java
  
  Index: Compiler.java
  ===
  RCS file: 
/home/cvs/jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/compiler/Compiler.java,v
  retrieving revision 1.74
  retrieving revision 1.75
  diff -u -r1.74 -r1.75
  --- Compiler.java 10 Nov 2003 22:26:20 -  1.74
  +++ Compiler.java 6 Jan 2004 19:42:39 -   1.75
  @@ -545,25 +545,28 @@
   }
   
   Iterator it = depends.iterator();
  +boolean outDated = false;
   while (it.hasNext()) {
   String include = (String)it.next();
   try {
   URL includeUrl = ctxt.getResource(include);
   if (includeUrl == null) {
   //System.out.println(Compiler: outdated, no includeUri  + 
include );
  -return true;
  +outDated = true;
   }
   if (includeUrl.openConnection().getLastModified() 
   targetLastModified) {
   //System.out.println(Compiler: outdated, include old  + 
include );
  -return true;
  +outDated = true;
  +// Remove any potential Wrappers for tag files
  +ctxt.getRuntimeContext().removeWrapper(include);
   }
   } catch (Exception e) {
   e.printStackTrace();
  -return true;
  +outDated = true;
   }
   }
  -return false;
  +return outDated;
   
   }
   
  
  
  

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

2003-12-15 Thread kinman
kinman  2003/12/15 11:24:20

  Modified:jasper2/src/share/org/apache/jasper/compiler Parser.java
  Log:
  - Revert the last commit, as it did not conform to spec, and breaks TCK tests.
  
  Revision  ChangesPath
  1.87  +3 -4  
jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/compiler/Parser.java
  
  Index: Parser.java
  ===
  RCS file: 
/home/cvs/jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/compiler/Parser.java,v
  retrieving revision 1.86
  retrieving revision 1.87
  diff -u -r1.86 -r1.87
  --- Parser.java   11 Dec 2003 18:24:21 -  1.86
  +++ Parser.java   15 Dec 2003 19:24:20 -  1.87
  @@ -1090,7 +1090,6 @@
 lt; + tag );
}
   
  -reader.skipSpaces();
   if( reader.matchesETag( tag ) ) {
   // EmptyBody
   return;
  
  
  

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



cvs commit: jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/resources messages.properties

2003-12-11 Thread kinman
kinman  2003/12/11 10:24:22

  Modified:jasper2/src/share/org/apache/jasper/compiler Parser.java
   jasper2/src/share/org/apache/jasper/resources
messages.properties
  Log:
  - Fix 25448: Allow white spaces in an empty body for jsp:include
  
  Revision  ChangesPath
  1.86  +4 -3  
jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/compiler/Parser.java
  
  Index: Parser.java
  ===
  RCS file: 
/home/cvs/jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/compiler/Parser.java,v
  retrieving revision 1.85
  retrieving revision 1.86
  diff -u -r1.85 -r1.86
  --- Parser.java   4 Dec 2003 19:37:58 -   1.85
  +++ Parser.java   11 Dec 2003 18:24:21 -  1.86
  @@ -1090,6 +1090,7 @@
 lt; + tag );
}
   
  +reader.skipSpaces();
   if( reader.matchesETag( tag ) ) {
   // EmptyBody
   return;
  
  
  
  1.137 +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.136
  retrieving revision 1.137
  diff -u -r1.136 -r1.137
  --- messages.properties   10 Dec 2003 00:24:23 -  1.136
  +++ messages.properties   11 Dec 2003 18:24:21 -  1.137
  @@ -116,7 +116,7 @@
   jsp.error.include.badflush=jsp:include page=\...\ flush=\true\ is the only 
valid combination in JSP 1.0
   jsp.error.attempt_to_clear_flushed_buffer=Error: Attempt to clear a buffer that's 
already been flushed
   jsp.error.overflow=Error: JSP Buffer overflow
  -jsp.error.paramexpected=Expected \param\ tag with \name\ and \value\ 
attributes
  +jsp.error.paramexpected=Expecting \jsp:param\ standard action with \name\ and 
\value\ attributes
   jsp.error.param.invalidUse=The jsp:param action must not be used outside the 
jsp:include, jsp:forward, or jsp:params elements
   jsp.error.params.invalidUse=jsp:params must be a direct child of jsp:plugin
   jsp.error.fallback.invalidUse=jsp:fallback must be a direct child of jsp:plugin
  
  
  

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



cvs commit: jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/resources messages.properties

2003-12-09 Thread kinman
kinman  2003/12/09 16:24:23

  Modified:jasper2/src/share/org/apache/jasper/compiler
TagFileProcessor.java
   jasper2/src/share/org/apache/jasper/resources
messages.properties
  Log:
  - The spec allows an attribute to be specified in multple tag directives,
if they have the same value.  It is an error if not.
  
  Revision  ChangesPath
  1.55  +27 -8 
jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/compiler/TagFileProcessor.java
  
  Index: TagFileProcessor.java
  ===
  RCS file: 
/home/cvs/jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/compiler/TagFileProcessor.java,v
  retrieving revision 1.54
  retrieving revision 1.55
  diff -u -r1.54 -r1.55
  --- TagFileProcessor.java 5 Dec 2003 18:33:19 -   1.54
  +++ TagFileProcessor.java 10 Dec 2003 00:24:23 -  1.55
  @@ -142,6 +142,7 @@
   private String smallIcon = null;
   private String largeIcon = null;
   private String dynamicAttrsMapName;
  +private String example = null;
   
   private Vector attributeVector;
   private Vector variableVector;
  @@ -176,7 +177,7 @@
   JspUtil.checkAttributes(Tag directive, n, tagDirectiveAttrs,
   err);
   
  -bodycontent = n.getAttributeValue(body-content);
  +bodycontent = checkConflict(n, bodycontent, body-content);
   if (bodycontent != null 
   !bodycontent.equalsIgnoreCase(TagInfo.BODY_CONTENT_EMPTY) 
   
!bodycontent.equalsIgnoreCase(TagInfo.BODY_CONTENT_TAG_DEPENDENT) 
  @@ -184,15 +185,33 @@
   err.jspError(n, jsp.error.tagdirective.badbodycontent,
bodycontent);
   }
  -dynamicAttrsMapName = n.getAttributeValue(dynamic-attributes);
  +dynamicAttrsMapName = checkConflict(n, dynamicAttrsMapName,
  +dynamic-attributes);
   if (dynamicAttrsMapName != null) {
   checkUniqueName(dynamicAttrsMapName, TAG_DYNAMIC, n);
   }
  -smallIcon = n.getAttributeValue(small-icon);
  -largeIcon = n.getAttributeValue(large-icon);
  -description = n.getAttributeValue(description);
  -displayName = n.getAttributeValue(display-name);
  +smallIcon = checkConflict(n, smallIcon, small-icon);
  +largeIcon = checkConflict(n, largeIcon, large-icon);
  +description = checkConflict(n, description, description);
  +displayName = checkConflict(n, displayName, display-name);
  +example = checkConflict(n, example, example);
   }
  +
  +private String checkConflict(Node n, String oldAttrValue, String attr)
  +throws JasperException {
  +
  +String result = oldAttrValue;
  +String attrValue = n.getAttributeValue(attr);
  +if (attrValue != null) {
  +if (oldAttrValue != null  !oldAttrValue.equals(attrValue)) {
  +err.jspError(n, jsp.error.tag.conflict.attr, attr,
  + oldAttrValue, attrValue);
  +}
  +result = attrValue;
  +}
  +return result;
  +}
  +
   
   public void visit(Node.AttributeDirective n) throws JasperException {
   
  
  
  
  1.136 +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.135
  retrieving revision 1.136
  diff -u -r1.135 -r1.136
  --- messages.properties   4 Dec 2003 19:37:58 -   1.135
  +++ messages.properties   10 Dec 2003 00:24:23 -  1.136
  @@ -67,6 +67,7 @@
   jsp.error.page.invalid.iselignored=Page directive: invalid value for isELIgnored
   jsp.error.tag.invalid.iselignored=Tag directive: invalid value for isELIgnored
   jsp.error.page.multi.pageencoding=Page directive must not have multiple occurrences 
of pageencoding
  +jsp.error.tag.conflict.attr=Tag directive: illegal to have multiple occurrences of 
the attribute \{0}\ with different values (old: {1}, new: {2})
   jsp.error.tag.multi.pageencoding=Tag directive must not have multiple occurrences 
of pageencoding
   jsp.error.page.bad_b_and_a_combo=Page directive: Illegal combination of 
buffer=\none\  autoFlush=\false\
   jsp.error.not.impl.taglib=Internal error: Tag extensions not implemented
  
  
  

-
To unsubscribe, e-mail

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

2003-12-08 Thread kinman
kinman  2003/12/08 18:51:35

  Modified:jasper2/src/share/org/apache/jasper/compiler SmapUtil.java
  Log:
  - Fix 25263: bad smap when template text got concatenated.
  
  Revision  ChangesPath
  1.21  +6 -3  
jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/compiler/SmapUtil.java
  
  Index: SmapUtil.java
  ===
  RCS file: 
/home/cvs/jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/compiler/SmapUtil.java,v
  retrieving revision 1.20
  retrieving revision 1.21
  diff -u -r1.20 -r1.21
  --- SmapUtil.java 22 Oct 2003 19:10:58 -  1.20
  +++ SmapUtil.java 9 Dec 2003 02:51:35 -   1.21
  @@ -613,19 +613,22 @@
   //Add a LineInfo that corresponds to the beginning of this node
   int iInputStartLine = mark.getLineNumber();
   int iOutputStartLine = n.getBeginJavaLine();
  -smap.addLineData(iInputStartLine, fileName, 1, iOutputStartLine, 1);
  +int iOutputLineIncrement = breakAtLF? 1: 0;
  +smap.addLineData(iInputStartLine, fileName, 1, iOutputStartLine, 
  + iOutputLineIncrement);
   
   // Output additional mappings in the text
   java.util.ArrayList extraSmap = n.getExtraSmap();
   
   if (extraSmap != null) {
   for (int i = 0; i  extraSmap.size(); i++) {
  +iOutputStartLine += iOutputLineIncrement;
   smap.addLineData(
   iInputStartLine+((Integer)extraSmap.get(i)).intValue(),
   fileName,
   1,
  -++iOutputStartLine,
  -1);
  +iOutputStartLine,
  +iOutputLineIncrement);
   }
   }
   }
  
  
  

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

2003-12-05 Thread kinman
kinman  2003/12/05 10:33:19

  Modified:jasper2/src/share/org/apache/jasper/compiler
TagFileProcessor.java
  Log:
  - For tag files, don't issue error for multiple definition when both are for
dynamic-attributes.
  
  Revision  ChangesPath
  1.54  +3 -3  
jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/compiler/TagFileProcessor.java
  
  Index: TagFileProcessor.java
  ===
  RCS file: 
/home/cvs/jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/compiler/TagFileProcessor.java,v
  retrieving revision 1.53
  retrieving revision 1.54
  diff -u -r1.53 -r1.54
  --- TagFileProcessor.java 4 Dec 2003 19:37:58 -   1.53
  +++ TagFileProcessor.java 5 Dec 2003 18:33:19 -   1.54
  @@ -401,7 +401,7 @@
   HashMap table = (type == VAR_NAME_FROM)? nameFromTable: nameTable;
   NameEntry nameEntry = (NameEntry) table.get(name);
   if (nameEntry != null) {
  -if (type != TAG_DYNAMIC) {
  +if (type != TAG_DYNAMIC || nameEntry.getType() != TAG_DYNAMIC) {
   int line = nameEntry.getNode().getStart().getLineNumber();
   err.jspError(n, jsp.error.tagfile.nameNotUnique,
type, nameEntry.getType(), Integer.toString(line));
  
  
  

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



cvs commit: jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/resources messages.properties messages_es.properties messages_fr.properties messages_ja.properties

2003-12-04 Thread kinman
kinman  2003/12/04 11:37:58

  Modified:jasper2/src/share/org/apache/jasper/compiler Parser.java
TagFileProcessor.java
   jasper2/src/share/org/apache/jasper/resources
messages.properties messages_es.properties
messages_fr.properties messages_ja.properties
  Log:
  - Rewrite error checking when processing tag files to conform with the
lastest JSP spec.  Check that names declared in any of the following
in a translation unit is unique.
* name attribute in attribute directive
* name-given attribute in variable directive
* alias attribute in variable directive
* dynamic-attributes attribute in tag directive
  
except that dynamic-attributes attribute of the tag directive can be declared
more than once with the same value.
  
Also check that name-from-attribute attributes of variable directives are
unique, and that they refer to attribte directives declared in the same
translation unit, with the correct attribute values.
  
  Revision  ChangesPath
  1.85  +4 -3  
jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/compiler/Parser.java
  
  Index: Parser.java
  ===
  RCS file: 
/home/cvs/jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/compiler/Parser.java,v
  retrieving revision 1.84
  retrieving revision 1.85
  diff -u -r1.84 -r1.85
  --- Parser.java   29 Oct 2003 21:53:43 -  1.84
  +++ Parser.java   4 Dec 2003 19:37:58 -   1.85
  @@ -1942,6 +1942,7 @@
reader.setSingleFile(true);
reader.skipUntil();
   while (reader.hasMoreInput()) {
  +start = reader.mark();
   if (reader.matches(%--)) {
   parseComment(parent);
   } else if (reader.matches(%@)) {
  
  
  
  1.53  +114 -93   
jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/compiler/TagFileProcessor.java
  
  Index: TagFileProcessor.java
  ===
  RCS file: 
/home/cvs/jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/compiler/TagFileProcessor.java,v
  retrieving revision 1.52
  retrieving revision 1.53
  diff -u -r1.52 -r1.53
  --- TagFileProcessor.java 2 Sep 2003 21:39:59 -   1.52
  +++ TagFileProcessor.java 4 Dec 2003 19:37:58 -   1.53
  @@ -68,6 +68,7 @@
   import java.net.URLClassLoader;
   import java.util.Iterator;
   import java.util.Vector;
  +import java.util.HashMap;
   
   import javax.servlet.jsp.tagext.TagAttributeInfo;
   import javax.servlet.jsp.tagext.TagExtraInfo;
  @@ -145,6 +146,19 @@
   private Vector attributeVector;
   private Vector variableVector;
   
  +private static final String ATTR_NAME =
  +the name attribute of the attribute directive;
  +private static final String VAR_NAME_GIVEN =
  +the name-given attribute of the variable directive;
  +private static final String VAR_NAME_FROM =
  +the name-from-attribute attribute of the variable directive;
  +private static final String VAR_ALIAS =
  +the alias attribute of the variable directive;
  +private static final String TAG_DYNAMIC =
  +the dynamic-attributes attribute of the tag directive;
  +private HashMap nameTable = new HashMap();
  +private HashMap nameFromTable = new HashMap();
  +
   public TagFileDirectiveVisitor(Compiler compiler,
  TagLibraryInfo tagLibInfo,
  String name,
  @@ -171,6 +185,9 @@
bodycontent);
   }
   dynamicAttrsMapName = n.getAttributeValue(dynamic-attributes);
  +if (dynamicAttrsMapName != null) {
  +checkUniqueName(dynamicAttrsMapName, TAG_DYNAMIC, n);
  +}
   smallIcon = n.getAttributeValue(small-icon);
   largeIcon = n.getAttributeValue(large-icon);
   description = n.getAttributeValue(description);
  @@ -210,9 +227,11 @@
   type = java.lang.String;
   }
   
  -attributeVector.addElement(
  +TagAttributeInfo tagAttributeInfo =
   new TagAttributeInfo(attrName, required, type, rtexprvalue,
  - fragment));
  + fragment);
  +attributeVector.addElement(tagAttributeInfo);
  +checkUniqueName(attrName, ATTR_NAME, n, tagAttributeInfo);
   }
   
   public void visit(Node.VariableDirective n) throws JasperException {
  @@ -265,6 +284,12 @@
 * denotes the name of the variable that is being aliased
 */
   nameGiven = alias

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

2003-12-04 Thread kinman
kinman  2003/12/04 14:57:45

  Modified:jasper2/src/share/org/apache/jasper/compiler
ParserController.java
  Log:
  - When a tag file include a file, make sure the included file environment
maintains the isTag and directiveOnly properties.
  
  Revision  ChangesPath
  1.48  +8 -2  
jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/compiler/ParserController.java
  
  Index: ParserController.java
  ===
  RCS file: 
/home/cvs/jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/compiler/ParserController.java,v
  retrieving revision 1.47
  retrieving revision 1.48
  diff -u -r1.47 -r1.48
  --- ParserController.java 1 Dec 2003 19:31:37 -   1.47
  +++ ParserController.java 4 Dec 2003 22:57:45 -   1.48
  @@ -103,6 +103,8 @@
   private String sourceEnc;
   
   private boolean isDefaultPageEncoding;
  +private boolean isTagFile;
  +private boolean directiveOnly;
   
   /*
* Constructor
  @@ -132,7 +134,8 @@
// (using an include directive), ctxt.getTagFileJar() returns the 
// JAR file from which to read the tag file or included resource,
// respectively.
  - return parse(inFileName, null, ctxt.getTagFileJarUrl());
  + return parse(inFileName, null, ctxt.isTagFile(), false,
  + ctxt.getTagFileJarUrl());
   }
   
   /**
  @@ -146,7 +149,8 @@
   public Node.Nodes parse(String inFileName, Node parent,
URL jarFileUrl)
throws FileNotFoundException, JasperException, IOException {
  - return parse(inFileName, parent, ctxt.isTagFile(), false, jarFileUrl);
  +// For files statically included, keep isTagfile and directiveOnly
  + return parse(inFileName, parent, isTagFile, directiveOnly, jarFileUrl);
   }
   
   /**
  @@ -187,6 +191,8 @@
Node.Nodes parsedPage = null;
isEncodingSpecifiedInProlog = false;
isDefaultPageEncoding = false;
  +this.isTagFile = isTagFile;
  +this.directiveOnly = directiveOnly;
   
JarFile jarFile = getJarFile(jarFileUrl);
String absFileName = resolveFileName(inFileName);
  
  
  

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

2003-12-01 Thread kinman
kinman  2003/12/01 11:31:37

  Modified:jasper2/src/share/org/apache/jasper/compiler
ParserController.java
  Log:
  -Avoid using deprecated method.
  
  Revision  ChangesPath
  1.47  +2 -2  
jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/compiler/ParserController.java
  
  Index: ParserController.java
  ===
  RCS file: 
/home/cvs/jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/compiler/ParserController.java,v
  retrieving revision 1.46
  retrieving revision 1.47
  diff -u -r1.46 -r1.47
  --- ParserController.java 2 Sep 2003 21:39:59 -   1.46
  +++ ParserController.java 1 Dec 2003 19:31:37 -   1.47
  @@ -551,13 +551,13 @@
}
index += xmlnsDecl.length();
while (index  root.length()
  - Character.isSpace(root.charAt(index))) {
  + Character.isWhitespace(root.charAt(index))) {
index++;
}
if (index  root.length()  root.charAt(index) == '=') {
index++;
while (index  root.length()
  - Character.isSpace(root.charAt(index))) {
  + Character.isWhitespace(root.charAt(index))) {
index++;
}
if (index  root.length()  root.charAt(index++) == ''
  
  
  

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

2003-11-25 Thread kinman
kinman  2003/11/25 10:51:47

  Modified:jasper2/src/share/org/apache/jasper/compiler
JspDocumentParser.java
  Log:
  - In XML syntax, recognize \$ escape sequence in template text.
  
  Revision  ChangesPath
  1.73  +11 -8 
jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/compiler/JspDocumentParser.java
  
  Index: JspDocumentParser.java
  ===
  RCS file: 
/home/cvs/jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/compiler/JspDocumentParser.java,v
  retrieving revision 1.72
  retrieving revision 1.73
  diff -u -r1.72 -r1.73
  --- JspDocumentParser.java24 Nov 2003 23:51:10 -  1.72
  +++ JspDocumentParser.java25 Nov 2003 18:51:47 -  1.73
  @@ -523,18 +523,21 @@
   ttext.write(ch);
   lastCh = ch;
   }
  +} else if (lastCh == '\\'  ch == '$') {
  +ttext.write('$');
  +ch = 0;  // Not start of EL anymore
   } else {
  -if ((lastCh == '$')  (ch != '{')) {
  -ttext.write('$');
  +if (lastCh == '$' || lastCh == '\\') {
  +ttext.write(lastCh);
   }
  -if (ch != '$') {
  +if (ch != '$'  ch != '\\') {
   ttext.write(ch);
   }
   }
   lastCh = ch;
   }
  -if (lastCh == '$') {
  -ttext.write('$');
  +if (lastCh == '$' || lastCh == '\\') {
  +ttext.write(lastCh);
   }
   if (ttext.size()  0) {
   new Node.TemplateText(ttext.toString(), startMark, current);
  
  
  

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

2003-11-25 Thread kinman
kinman  2003/11/25 14:59:27

  Modified:jasper2/src/share/org/apache/jasper/compiler
JspDocumentParser.java
  Log:
  - Make sure that white spaces in template texts around ![CDATA[...]]
are trimmed.
  
  Revision  ChangesPath
  1.74  +9 -4  
jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/compiler/JspDocumentParser.java
  
  Index: JspDocumentParser.java
  ===
  RCS file: 
/home/cvs/jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/compiler/JspDocumentParser.java,v
  retrieving revision 1.73
  retrieving revision 1.74
  diff -u -r1.73 -r1.74
  --- JspDocumentParser.java25 Nov 2003 18:51:47 -  1.73
  +++ JspDocumentParser.java25 Nov 2003 22:59:27 -  1.74
  @@ -615,6 +615,9 @@
* See org.xml.sax.ext.LexicalHandler.
*/
   public void comment(char[] buf, int offset, int len) throws SAXException {
  +
  +processChars();  // Flush char buffer and remove white spaces
  +
   // ignore comments in the DTD
   if (!inDTD) {
   startMark =
  @@ -630,6 +633,8 @@
* See org.xml.sax.ext.LexicalHandler.
*/
   public void startCDATA() throws SAXException {
  +
  +processChars();  // Flush char buffer and remove white spaces
   startMark =
   new Mark(path, locator.getLineNumber(), locator.getColumnNumber());
   }
  @@ -638,7 +643,7 @@
* See org.xml.sax.ext.LexicalHandler.
*/
   public void endCDATA() throws SAXException {
  -// do nothing
  +processChars();  // Flush char buffer and remove white spaces
   }
   
   /*
  
  
  

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



cvs commit: jakarta-tomcat-catalina/tester/web/golden JspDoc02.txt

2003-11-25 Thread kinman
kinman  2003/11/25 15:05:13

  Modified:tester/web/golden JspDoc02.txt
  Log:
  - Update golden file to reflect changes in jasper regarding template text
output in XML syntax.   Sorry, Remy :)
  
  Revision  ChangesPath
  1.3   +0 -5  jakarta-tomcat-catalina/tester/web/golden/JspDoc02.txt
  
  Index: JspDoc02.txt
  ===
  RCS file: /home/cvs/jakarta-tomcat-catalina/tester/web/golden/JspDoc02.txt,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- JspDoc02.txt  25 Nov 2003 08:31:55 -  1.2
  +++ JspDoc02.txt  25 Nov 2003 23:05:13 -  1.3
  @@ -1,12 +1,7 @@
   htmlheadtitleExample JSP in XML format/title/headbody
   This is the output of a simple JSP using XML format. 
   br/divUse a jsp:scriptlet to loop from 1 to 10: /div1, 2, 3, 4, 5, 6, 7, 8, 
9, 10
  -
  -
  -
 brbr
  -
  -
   div align=left
 Use a jsp:expression to write something: 
 foo/div
  
  
  

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

2003-11-24 Thread kinman
kinman  2003/11/24 15:51:10

  Modified:jasper2/src/share/org/apache/jasper/compiler
JspDocumentParser.java
  Log:
  - Fix 24779: Jasper fails to compile a valid JSP document (xml syntax) when
an EL string in template text contains a [].  The fix to to buffer and
concatenate template text strings and only start processing the texts when
they are all in one piece.
  
This, BTW, also fixes the bug that somestimes trims the white spaces that
trails template texts.
  
  Revision  ChangesPath
  1.72  +42 -15
jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/compiler/JspDocumentParser.java
  
  Index: JspDocumentParser.java
  ===
  RCS file: 
/home/cvs/jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/compiler/JspDocumentParser.java,v
  retrieving revision 1.71
  retrieving revision 1.72
  diff -u -r1.71 -r1.72
  --- JspDocumentParser.java22 Nov 2003 02:09:34 -  1.71
  +++ JspDocumentParser.java24 Nov 2003 23:51:10 -  1.72
  @@ -90,6 +90,7 @@
* syntax.
*
* @author Jan Luehe
  + * @author Kin-man Chung
*/
   
   class JspDocumentParser
  @@ -110,6 +111,7 @@
   private JspCompilationContext ctxt;
   private PageInfo pageInfo;
   private String path;
  +private StringBuffer charBuffer;
   
   // Node representing the XML element currently being parsed
   private Node current;
  @@ -287,6 +289,8 @@
   AttributesImpl nonTaglibAttrs = null;
   AttributesImpl nonTaglibXmlnsAttrs = null;
   
  +processChars();
  +
   checkPrefixes(uri, qName, attrs);
   
   if (directivesOnly 
  @@ -399,14 +403,33 @@
   /*
* Receives notification of character data inside an element.
*
  + * The SAX does not call this method with all of the template text, but may
  + * invoke this method with chunks of it.  This is a problem when we try
  + * to determine if the text contains only whitespaces, or when we are
  + * looking for an EL expression string.  Therefore it is necessary to
  + * buffer and concatenate the chunks and process the concatenated text 
  + * later (at beginTag and endTag)
  + *
* @param buf The characters
* @param offset The start position in the character array
* @param len The number of characters to use from the character array
*
* @throws SAXException
*/
  -public void characters(char[] buf, int offset, int len)
  -throws SAXException {
  +public void characters(char[] buf, int offset, int len) {
  +
  +if (charBuffer == null) {
  +charBuffer = new StringBuffer();
  +}
  +charBuffer.append(buf, offset, len);
  +}
  +
  +private void processChars() throws SAXException {
  +
  +if (charBuffer == null) {
  +return;
  +}
  +
   /*
* JSP.6.1.1: All textual nodes that have only white space are to be
* dropped from the document, except for nodes in a jsp:text element,
  @@ -418,11 +441,11 @@
   boolean isAllSpace = true;
   if (!(current instanceof Node.JspText)
!(current instanceof Node.NamedAttribute)) {
  -for (int i = offset; i  offset + len; i++) {
  -if (!(buf[i] == ' '
  -|| buf[i] == '\n'
  -|| buf[i] == '\r'
  -|| buf[i] == '\t')) {
  +for (int i = 0; i  charBuffer.length(); i++) {
  +if (!(charBuffer.charAt(i) == ' '
  +|| charBuffer.charAt(i) == '\n'
  +|| charBuffer.charAt(i) == '\r'
  +|| charBuffer.charAt(i) == '\t')) {
   isAllSpace = false;
   break;
   }
  @@ -436,10 +459,10 @@
   int column = startMark.getColumnNumber();
   
   CharArrayWriter ttext = new CharArrayWriter();
  -int limit = offset + len;
   int lastCh = 0;
  -for (int i = offset; i  limit; i++) {
  -int ch = buf[i];
  +for (int i = 0; i  charBuffer.length(); i++) {
  +
  +int ch = charBuffer.charAt(i);
   if (ch == '\n') {
   column = 1;
   line++;
  @@ -463,7 +486,7 @@
   boolean doubleQ = false;
   lastCh = 0;
   for (;; i++) {
  -if (i = limit) {
  +if (i = charBuffer.length()) {
   throw new SAXParseException(
   Localizer.getMessage(
   jsp.error.unterminated,
  @@ -471,7 +494,7 @@
   locator

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

2003-11-24 Thread kinman
kinman  2003/11/24 17:38:21

  Modified:jasper2/src/share/org/apache/jasper/compiler ELParser.java
  Log:
  - Fix 24957: Operators are mis-treated as functions
  
  Revision  ChangesPath
  1.3   +27 -1 
jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/compiler/ELParser.java
  
  Index: ELParser.java
  ===
  RCS file: 
/home/cvs/jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/compiler/ELParser.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- ELParser.java 30 Oct 2003 02:39:48 -  1.2
  +++ ELParser.java 25 Nov 2003 01:38:21 -  1.3
  @@ -77,6 +77,11 @@
   private String expression;   // The EL expression
   private boolean escapeBS;// is '\' an escape char in text outside EL?
   
  +private static final String reservedWords[] = {
  +and, div, empty, eq, false,
  +ge, gt, instanceof, le, lt, mod,
  +ne, not, null, or, true};
  +
   public ELParser(String expression) {
index = 0;
this.expression = expression;
  @@ -145,7 +150,7 @@
* Note: currently we don't parse arguments
*/
   private boolean parseFunction() {
  - if (! (curToken instanceof Id)) {
  + if (! (curToken instanceof Id) || isELReserved(curToken.toString())) {
return false;
}
String s1 = null; // Function prefix
  @@ -172,6 +177,27 @@
}
setIndex(mark);
return false;
  +}
  +
  +/**
  + * Test if an id is a reserved word in EL
  + */
  +private boolean isELReserved(String id) {
  +int i = 0;
  +int j = reservedWords.length;
  +while (i  j) {
  +int k = (i+j)/2;
  +int result = reservedWords[k].compareTo(id);
  +if (result == 0) {
  +return true;
  +}
  +if (result  0) {
  +i = k+1;
  +} else {
  +j = k;
  +}
  +}
  +return false;
   }
   
   /**
  
  
  

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



cvs commit: jakarta-servletapi-5/jsr152/examples/jsp2/jspx basic.jspx textRotate.jspx

2003-11-21 Thread kinman
kinman  2003/11/21 14:06:02

  Modified:jsr152/examples/WEB-INF/lib jstl.jar standard.jar
   jsr152/examples/WEB-INF/tags displayProducts.tag
   jsr152/examples/jsp2/jspx basic.jspx textRotate.jspx
  Log:
  - Patch by Jan Luehe:
  
  Update JSP examples to use JSTL 1.1
  
  Revision  ChangesPath
  1.2   +67 -81jakarta-servletapi-5/jsr152/examples/WEB-INF/lib/jstl.jar
  
Binary file
  
  
  1.2   +1069 -1880jakarta-servletapi-5/jsr152/examples/WEB-INF/lib/standard.jar
  
Binary file
  
  
  1.3   +1 -1  
jakarta-servletapi-5/jsr152/examples/WEB-INF/tags/displayProducts.tag
  
  Index: displayProducts.tag
  ===
  RCS file: 
/home/cvs/jakarta-servletapi-5/jsr152/examples/WEB-INF/tags/displayProducts.tag,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- displayProducts.tag   28 Oct 2002 17:45:44 -  1.2
  +++ displayProducts.tag   21 Nov 2003 22:06:02 -  1.3
  @@ -2,7 +2,7 @@
  - Copyright (c) 2002 The Apache Software Foundation.  All rights 
  - reserved.
   --%
  -%@ taglib prefix=c uri=http://java.sun.com/jstl/core_rt; %
  +%@ taglib prefix=c uri=http://java.sun.com/jsp/jstl/core; %
   %@ attribute name=normalPrice fragment=true %
   %@ attribute name=onSale fragment=true %
   %@ variable name-given=name %
  
  
  
  1.4   +1 -1  jakarta-servletapi-5/jsr152/examples/jsp2/jspx/basic.jspx
  
  Index: basic.jspx
  ===
  RCS file: /home/cvs/jakarta-servletapi-5/jsr152/examples/jsp2/jspx/basic.jspx,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- basic.jspx12 May 2003 16:52:09 -  1.3
  +++ basic.jspx21 Nov 2003 22:06:02 -  1.4
  @@ -1,6 +1,6 @@
   tags:xhtmlbasic xmlns:tags=urn:jsptagdir:/WEB-INF/tags
xmlns:jsp=http://java.sun.com/JSP/Page;
  - xmlns:fmt=http://java.sun.com/jstl/fmt_rt;
  + xmlns:fmt=http://java.sun.com/jsp/jstl/fmt;
 xmlns=http://www.w3.org/1999/xhtml;
 jsp:directive.page contentType=text/html /
 head
  
  
  
  1.3   +1 -1  jakarta-servletapi-5/jsr152/examples/jsp2/jspx/textRotate.jspx
  
  Index: textRotate.jspx
  ===
  RCS file: /home/cvs/jakarta-servletapi-5/jsr152/examples/jsp2/jspx/textRotate.jspx,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- textRotate.jspx   5 May 2003 17:00:55 -   1.2
  +++ textRotate.jspx   21 Nov 2003 22:06:02 -  1.3
  @@ -5,7 +5,7 @@
 --
   svg xmlns=http://www.w3.org/2000/svg;
width=450 height=500 viewBox=0 0 450 500
  - xmlns:c=http://java.sun.com/jstl/core_rt;
  + xmlns:c=http://java.sun.com/jsp/jstl/core;
xmlns:jsp=http://java.sun.com/JSP/Page;
 jsp:directive.page contentType=image/svg+xml /
 titleJSP 2.0 JSPX/title
  
  
  

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

2003-11-21 Thread kinman
kinman  2003/11/21 18:09:35

  Modified:jasper2/src/share/org/apache/jasper/compiler
JspDocumentParser.java
  Log:
  - Fix bugzilla 24904: Nested custom tag causes bogus compilation errors.
  
  Revision  ChangesPath
  1.71  +10 -7 
jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/compiler/JspDocumentParser.java
  
  Index: JspDocumentParser.java
  ===
  RCS file: 
/home/cvs/jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/compiler/JspDocumentParser.java,v
  retrieving revision 1.70
  retrieving revision 1.71
  diff -u -r1.70 -r1.71
  --- JspDocumentParser.java1 Sep 2003 23:22:56 -   1.70
  +++ JspDocumentParser.java22 Nov 2003 02:09:34 -  1.71
  @@ -99,6 +99,7 @@
   private static final String JSP_VERSION = version;
   private static final String LEXICAL_HANDLER_PROPERTY =
   http://xml.org/sax/properties/lexical-handler;;
  +private static final String JSP_URI = http://java.sun.com/JSP/Page;;
   
   private static final EnableDTDValidationException 
ENABLE_DTD_VALIDATION_EXCEPTION =
   new EnableDTDValidationException(
  @@ -288,12 +289,13 @@
   
   checkPrefixes(uri, qName, attrs);
   
  -if (directivesOnly  !localName.startsWith(DIRECTIVE_ACTION)) {
  +if (directivesOnly 
  +!(JSP_URI.equals(uri)  localName.startsWith(DIRECTIVE_ACTION))) {
   return;
   }
   
   // jsp:text must not have any subelements
  -if (TEXT_ACTION.equals(current.getLocalName())) {
  +if (JSP_URI.equals(uri)  TEXT_ACTION.equals(current.getLocalName())) {
   throw new SAXParseException(
   Localizer.getMessage(jsp.error.text.has_subelement),
   locator);
  @@ -357,7 +359,7 @@
   
   Node node = null;
   
  -if (http://java.sun.com/JSP/Page.equals(uri)) {
  +if (JSP_URI.equals(uri)) {
   node =
   parseStandardAction(
   qName,
  @@ -525,7 +527,8 @@
   public void endElement(String uri, String localName, String qName)
   throws SAXException {
   
  -if (directivesOnly  !localName.startsWith(DIRECTIVE_ACTION)) {
  +if (directivesOnly 
  +!(JSP_URI.equals(uri)  localName.startsWith(DIRECTIVE_ACTION))) {
   return;
   }
   
  
  
  

-
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 Compiler.java TextOptimizer.java

2003-11-10 Thread kinman
kinman  2003/11/10 14:26:21

  Modified:jasper2/src/share/org/apache/jasper
EmbeddedServletOptions.java JspC.java Options.java
   jasper2/src/share/org/apache/jasper/compiler Compiler.java
TextOptimizer.java
  Log:
  - Provide an option to trim white spaces that appear in a template text
between two actions/directives.  This also fixes 24506.  Since this is
NOT spec conformant, the default is don't do.
  
  Revision  ChangesPath
  1.7   +15 -18
jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/EmbeddedServletOptions.java
  
  Index: EmbeddedServletOptions.java
  ===
  RCS file: 
/home/cvs/jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/EmbeddedServletOptions.java,v
  retrieving revision 1.6
  retrieving revision 1.7
  diff -u -r1.6 -r1.7
  --- EmbeddedServletOptions.java   9 Sep 2003 21:46:22 -   1.6
  +++ EmbeddedServletOptions.java   10 Nov 2003 22:26:20 -  1.7
  @@ -105,12 +105,9 @@
   private boolean keepGenerated = true;
   
   /**
  - * Do you want support for large files? What this essentially
  - * means is that we generated code so that the HTML data in a JSP
  - * file is stored separately as opposed to those constant string
  - * data being used literally in the generated servlet. 
  + * Should white spaces between directives or actions be trimmed?
*/
  -private boolean largeFile = false;
  +private boolean trimSpaces = false;
   
   /**
* Determines whether tag handler pooling is enabled.
  @@ -228,10 +225,10 @@
   }
   
   /**
  - * Are we supporting large files?
  + * Should white spaces between directives or actions be trimmed?
*/
  -public boolean getLargeFile() {
  -return largeFile;
  +public boolean getTrimSpaces() {
  +return trimSpaces;
   }
   
   public boolean isPoolingEnabled() {
  @@ -394,15 +391,15 @@
   }
   
   
  -String largeFile = config.getInitParameter(largefile); 
  -if (largeFile != null) {
  -if (largeFile.equalsIgnoreCase(true)) {
  -this.largeFile = true;
  -} else if (largeFile.equalsIgnoreCase(false)) {
  -this.largeFile = false;
  +String trimsp = config.getInitParameter(trimSpaces); 
  +if (trimsp != null) {
  +if (trimsp.equalsIgnoreCase(true)) {
  +trimSpaces = true;
  +} else if (trimsp.equalsIgnoreCase(false)) {
  +trimSpaces = false;
   } else {
if (log.isWarnEnabled()) {
  - log.warn(Localizer.getMessage(jsp.warning.largeFile));
  + log.warn(Localizer.getMessage(jsp.warning.trimspaces));
}
}
   }
  
  
  
  1.61  +10 -6 
jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/JspC.java
  
  Index: JspC.java
  ===
  RCS file: 
/home/cvs/jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/JspC.java,v
  retrieving revision 1.60
  retrieving revision 1.61
  diff -u -r1.60 -r1.61
  --- JspC.java 9 Sep 2003 21:46:22 -   1.60
  +++ JspC.java 10 Nov 2003 22:26:20 -  1.61
  @@ -172,7 +172,7 @@
   private static int die; 
   private String classPath = null;
   private URLClassLoader loader = null;
  -private boolean largeFile = false;
  +private boolean trimSpaces = false;
   private boolean xpoweredBy;
   private boolean mappedFile = false;
   private File scratchDir;
  @@ -331,8 +331,12 @@
   return true;
   }
   
  -public boolean getLargeFile() {
  -return largeFile;
  +public boolean getTrimSpaces() {
  +return trimSpaces;
  +}
  +
  +public void setTrimSpaces(boolean ts) {
  +this.trimSpaces = ts;
   }
   
   public boolean isPoolingEnabled() {
  
  
  
  1.19  +8 -8  
jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/Options.java
  
  Index: Options.java
  ===
  RCS file: 
/home/cvs/jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/Options.java,v
  retrieving revision 1.18
  retrieving revision 1.19
  diff -u -r1.18 -r1.19
  --- Options.java  9 Sep 2003 21:46:22 -   1.18
  +++ Options.java  10 Nov 2003 22:26:20 -  1.19
  @@ -82,11 +82,6 @@
   public boolean getKeepGenerated();
   
   /**
  - * Are we supporting large files?
  - */
  -public boolean getLargeFile();
  -
  -/**
* Returns true if tag handler pooling is enabled, false otherwise.
*/
   public boolean isPoolingEnabled();
  @@ -131,6 +126,11 @@
* Ignored is suppressSmap() is true

cvs commit: jakarta-tomcat-catalina/catalina/src/conf web.xml

2003-11-10 Thread kinman
kinman  2003/11/10 14:51:21

  Modified:catalina/src/conf web.xml
  Log:
  Document Jasper option trimSpaces
  
  Revision  ChangesPath
  1.26  +3 -0  jakarta-tomcat-catalina/catalina/src/conf/web.xml
  
  Index: web.xml
  ===
  RCS file: /home/cvs/jakarta-tomcat-catalina/catalina/src/conf/web.xml,v
  retrieving revision 1.25
  retrieving revision 1.26
  diff -u -r1.25 -r1.26
  --- web.xml   9 Sep 2003 21:47:11 -   1.25
  +++ web.xml   10 Nov 2003 22:51:21 -  1.26
  @@ -148,6 +148,9 @@
 !--   print statement per input line, to ease--
 !--   debugging?  [false]--
 !--  --
  +  !--   trimSpaces  Should white spaces in template text between   --
  +  !--   actions or directives be trimmed?  [false] --
  +  !--  --
 !--   reloading   Should Jasper check for modified JSPs?  [true] --
 !--  --
 !--   suppressSmapShould the generation of SMAP info for JSR45   --
  
  
  

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

2003-11-05 Thread kinman
kinman  2003/11/05 10:31:34

  Modified:jasper2/src/share/org/apache/jasper/compiler Generator.java
  Log:
  - A smal performance improvement: instantiate the bean object with its
constructor, if class attribute is specified in usebean, instead of
going thru java.beans.Beans.instantiate().
  
  Revision  ChangesPath
  1.215 +35 -31
jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/compiler/Generator.java
  
  Index: Generator.java
  ===
  RCS file: 
/home/cvs/jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/compiler/Generator.java,v
  retrieving revision 1.214
  retrieving revision 1.215
  diff -u -r1.214 -r1.215
  --- Generator.java20 Oct 2003 21:07:46 -  1.214
  +++ Generator.java5 Nov 2003 18:31:34 -   1.215
  @@ -1259,37 +1259,41 @@
   className =
   attributeValue(beanName, false, String.class);
   }
  +out.printil(try {);
  +out.pushIndent();
  +out.printin(name);
  +out.print( = ();
  +out.print(type);
  +out.print() java.beans.Beans.instantiate();
  +out.print(this.getClass().getClassLoader(), );
  +out.print(className);
  +out.println(););
  +out.popIndent();
  +/*
  + * Note: Beans.instantiate throws ClassNotFoundException
  + * if the bean class is abstract.
  + */
  +out.printil(} catch (ClassNotFoundException exc) {);
  +out.pushIndent();
  +out.printil(
  +throw new InstantiationException(exc.getMessage()););
  +out.popIndent();
  +out.printil(} catch (Exception exc) {);
  +out.pushIndent();
  +out.printin(throw new ServletException();
  +out.print(\Cannot create bean of class \ + );
  +out.print(className);
  +out.println(, exc););
  +out.popIndent();
  +out.printil(}); // close of try
   } else {
   // Implies klass is not null
  -className = quote(klass);
  +// Generate codes to instantiate the bean class
  +out.printin(name);
  +out.print( = new );
  +out.print(klass);
  +out.println((););
   }
  -out.printil(try {);
  -out.pushIndent();
  -out.printin(name);
  -out.print( = ();
  -out.print(type);
  -out.print() java.beans.Beans.instantiate();
  -out.print(this.getClass().getClassLoader(), );
  -out.print(className);
  -out.println(););
  -out.popIndent();
  -/*
  - * Note: Beans.instantiate throws ClassNotFoundException
  - * if the bean class is abstract.
  - */
  -out.printil(} catch (ClassNotFoundException exc) {);
  -out.pushIndent();
  -out.printil(
  -throw new InstantiationException(exc.getMessage()););
  -out.popIndent();
  -out.printil(} catch (Exception exc) {);
  -out.pushIndent();
  -out.printin(throw new ServletException();
  -out.print(\Cannot create bean of class \ + );
  -out.print(className);
  -out.println(, exc););
  -out.popIndent();
  -out.printil(}); // close of try
   /*
* Set attribute for bean in the specified scope
*/
  
  
  

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



cvs commit: jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/runtime JspRuntimeLibrary.java

2003-11-04 Thread kinman
kinman  2003/11/04 11:28:49

  Modified:jasper2/src/share/org/apache/jasper/runtime
JspRuntimeLibrary.java
  Log:
  - Use ISO-8859-1 as the default encoding for jsp:param since it is the
default encoding for the request object.
  
  Revision  ChangesPath
  1.25  +4 -4  
jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/runtime/JspRuntimeLibrary.java
  
  Index: JspRuntimeLibrary.java
  ===
  RCS file: 
/home/cvs/jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/runtime/JspRuntimeLibrary.java,v
  retrieving revision 1.24
  retrieving revision 1.25
  diff -u -r1.24 -r1.25
  --- JspRuntimeLibrary.java2 Sep 2003 21:39:59 -   1.24
  +++ JspRuntimeLibrary.java4 Nov 2003 19:28:49 -   1.25
  @@ -1020,7 +1020,7 @@
}
   
if (enc == null) {
  - enc = UTF-8;  // Is this right?
  + enc = ISO-8859-1; // The default request encoding 
}
   
StringBuffer out = new StringBuffer(s.length());
  
  
  

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



cvs commit: jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/resources messages.properties

2003-10-29 Thread kinman
kinman  2003/10/29 13:53:43

  Modified:jasper2/src/share/org/apache/jasper/compiler Parser.java
   jasper2/src/share/org/apache/jasper/resources
messages.properties
  Log:
  - Fix 10903: Generate errors for unbalanced end tags.
  
  Revision  ChangesPath
  1.84  +33 -5 
jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/compiler/Parser.java
  
  Index: Parser.java
  ===
  RCS file: 
/home/cvs/jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/compiler/Parser.java,v
  retrieving revision 1.83
  retrieving revision 1.84
  diff -u -r1.83 -r1.84
  --- Parser.java   28 Oct 2003 23:04:11 -  1.83
  +++ Parser.java   29 Oct 2003 21:53:43 -  1.84
  @@ -1596,7 +1596,8 @@
} else if (reader.matches(jsp:)) {
parseStandardAction(parent);
} else if (!parseCustomTag(parent)) {
  - parseTemplateText(parent);
  +checkUnbalancedEndTag();
  +parseTemplateText(parent);
}
   }
   
  @@ -1650,7 +1651,8 @@
} else if (reader.matches(jsp:)) {
parseStandardAction(parent);
} else if (!parseCustomTag(parent)) {
  - parseTemplateText(parent);
  +checkUnbalancedEndTag();
  +parseTemplateText(parent);
}
   
   scriptlessCount--;
  @@ -1712,8 +1714,34 @@
   err.jspError( reader.mark(), jsp.error.not.in.template,
Custom actions );
} else {
  +checkUnbalancedEndTag();
   parseTemplateText(parent);
}
  +}
  +
  +/*
  + * Flag as error if an unbalanced end tag appears by itself.
  + */
  +private void checkUnbalancedEndTag() throws JasperException {
  +
  +if (!reader.matches(/)) {
  +return;
  +}
  +
  +// Check for unbalanced standard actions
  +if (reader.matches(jsp:)) {
  +err.jspError(start, jsp.error.unbalanced.endtag, jsp:);
  +}
  +
  +// Check for unbalanced custom actions
  +String tagName = reader.parseToken(false);
  +int i = tagName.indexOf(':');
  +if (i == -1 || pageInfo.getURI(tagName.substring(0, i)) == null) {
  +reader.reset(start);
  +return;
  +}
  +
  +err.jspError(start, jsp.error.unbalanced.endtag, tagName);
   }
   
   /**
  
  
  
  1.134 +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.133
  retrieving revision 1.134
  diff -u -r1.133 -r1.134
  --- messages.properties   9 Sep 2003 21:46:22 -   1.133
  +++ messages.properties   29 Oct 2003 21:53:43 -  1.134
  @@ -402,3 +402,4 @@
   jsp.error.data.file.read=Error reading file \{0}\
   jsp.error.prefix.refined=Attempt to redefine the prefix {0} to {1}, when it was 
already defined as {2} in the current scope.
   jsp.error.nested_jsproot=Nested lt;jsp:rootgt;
  +jsp.error.unbalanced.endtag=The end tag \lt;/{0}\ is unbalanced
  
  
  

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



cvs commit: jakarta-tomcat-catalina/webapps/admin/service service.jsp

2003-10-29 Thread kinman
kinman  2003/10/29 13:57:17

  Modified:webapps/admin/host host.jsp
   webapps/admin/service service.jsp
  Log:
  - Don't comment out custom tags with !-- and --.  Use %-- and --% instead.
  
  Revision  ChangesPath
  1.11  +2 -0  jakarta-tomcat-catalina/webapps/admin/host/host.jsp
  
  Index: host.jsp
  ===
  RCS file: /home/cvs/jakarta-tomcat-catalina/webapps/admin/host/host.jsp,v
  retrieving revision 1.10
  retrieving revision 1.11
  diff -u -r1.10 -r1.11
  --- host.jsp  24 Aug 2003 22:52:46 -  1.10
  +++ host.jsp  29 Oct 2003 21:57:17 -  1.11
  @@ -71,6 +71,7 @@
   /controls:action
   controls:action disabled=true - 
/controls:action
   !--FIXME add/remove defaultcontext--
  +%--
   !--controls:action url='%= /AddDefaultContext.do?parent= +
 URLEncoder.encode(thisObjectName) %'
   bean:message key=actions.defaultcontexts.create/
  @@ -79,6 +80,7 @@
 URLEncoder.encode(thisObjectName) %'
   bean:message key=actions.defaultcontexts.deletes/
   /controls:action--
  +--%
   logic:notEqual name=hostName value='%= 
(String)request.getAttribute(adminAppHost) %'
   controls:action disabled=true
   -
  
  
  
  1.12  +2 -0  jakarta-tomcat-catalina/webapps/admin/service/service.jsp
  
  Index: service.jsp
  ===
  RCS file: /home/cvs/jakarta-tomcat-catalina/webapps/admin/service/service.jsp,v
  retrieving revision 1.11
  retrieving revision 1.12
  diff -u -r1.11 -r1.12
  --- service.jsp   12 May 2003 20:21:38 -  1.11
  +++ service.jsp   29 Oct 2003 21:57:17 -  1.12
  @@ -65,6 +65,7 @@
   -
 /controls:action
 !-- FIXME add/remove defaultcontext--
  +%--
 !--controls:action url='%= /AddDefaultContext.do?serviceName= +
   URLEncoder.encode(thisObjectName) %'
   bean:message key=actions.defaultcontexts.create/
  @@ -73,6 +74,7 @@
   URLEncoder.encode(thisObjectName) %'
   bean:message key=actions.defaultcontexts.deletes/
 /controls:action--
  +--%
 controls:action disabled=true
   -
 /controls:action
  
  
  

-
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 ELFunctionMapper.java ELNode.java ELParser.java

2003-10-29 Thread kinman
kinman  2003/10/29 18:39:48

  Modified:jasper2/src/share/org/apache/jasper/compiler
ELFunctionMapper.java ELNode.java ELParser.java
  Log:
  - Add some javacdocs.
  
  Revision  ChangesPath
  1.14  +33 -4 
jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/compiler/ELFunctionMapper.java
  
  Index: ELFunctionMapper.java
  ===
  RCS file: 
/home/cvs/jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/compiler/ELFunctionMapper.java,v
  retrieving revision 1.13
  retrieving revision 1.14
  diff -u -r1.13 -r1.14
  --- ELFunctionMapper.java 22 Sep 2003 21:01:20 -  1.13
  +++ ELFunctionMapper.java 30 Oct 2003 02:39:48 -  1.14
  @@ -62,18 +62,26 @@
   import org.apache.jasper.JasperException;
   
   /**
  - * This class generates a mapper for an EL expression
  + * This class generates functions mappers for the EL expressions in the page.
* Instead of a global mapper, a mapper is used for ecah call to EL
* evaluator, thus avoiding the prefix overlapping and redefinition
* issues.
  + *
  + * @author Kin-man Chung
*/
   
   public class ELFunctionMapper {
   static private int currFunc = 0;
   private ErrorDispatcher err;
  -StringBuffer ds;
  -StringBuffer ss;
  +StringBuffer ds;  // Contains codes to initialize the functions mappers.
  +StringBuffer ss;  // Contains declarations of the functions mappers.
   
  +/**
  + * Creates the functions mappers for all EL expressions in the JSP page.
  + *
  + * @param compiler Current compiler, mainly for accessing error dispatcher.
  + * @param page The current compilation unit.
  + */
   public static void map(Compiler compiler, Node.Nodes page) 
throws JasperException {
   
  @@ -94,6 +102,10 @@
}
   }
   
  +/**
  + * A visitor for the page.  The places where EL is allowed are scanned
  + * for functions, and if found functions mappers are created.
  + */
   class ELFunctionVisitor extends Node.Visitor {

/**
  @@ -171,9 +183,13 @@
}
}
   
  +/**
  + * Creates function mappers, if needed, from ELNodes
  + */
private void doMap(ELNode.Nodes el) 
throws JasperException {
   
  +// Only care about functions in ELNode's
class Fvisitor extends ELNode.Visitor {
ArrayList funcs = new ArrayList();
HashMap keyMap = new HashMap();
  @@ -190,7 +206,7 @@
return;
}
   
  - // First locate all functions in this expression
  + // First locate all unique functions in this EL
Fvisitor fv = new Fvisitor();
el.visit(fv);
ArrayList functions = fv.funcs;
  @@ -212,6 +228,7 @@
   
ds.append(   + decName + = );
ds.append(org.apache.jasper.runtime.ProtectedFunctionMapper);
  +
// Special case if there is only one function in the map
String funcMethod = null;
if (functions.size() == 1) {
  @@ -221,6 +238,7 @@
funcMethod =+ decName + .mapFunction;
}
   
  +// Setup arguments for either getMapForFunction or mapFunction
for (int i = 0; i  functions.size(); i++) {
ELNode.Function f = (ELNode.Function)functions.get(i);
FunctionInfo funcInfo = f.getFunctionInfo();
  @@ -266,6 +284,14 @@
el.setMapName(decName);
}
   
  +/**
  + * Find the name of the function mapper for an EL.  Reuse a
  + * previously generated one if possible.
  + * @param functions An ArrayList of ELNode.Function instances that
  + *  represents the functions in an EL
  + * @return A previous generated function mapper name that can be used
  + * by this EL; null if none found.
  + */
private String matchMap(ArrayList functions) {
   
String mapName = null;
  @@ -286,6 +312,9 @@
return mapName;
}
   
  +/*
  + * @return An unique name for a function mapper.
  + */
private String getMapName() {
return _jspx_fnmap_ + currFunc++;
}
  
  
  
  1.4   +10 -3 
jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/compiler/ELNode.java
  
  Index: ELNode.java
  ===
  RCS file: 
/home/cvs/jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/compiler/ELNode.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- ELNode.java   25 Mar 2003 01:49:29 -  1.3
  +++ ELNode.java   30 Oct 2003 02:39:48 -  1.4
  @@ -66,6 +66,8 @@
*
* It currently only defines functions.  It can be expanded

cvs commit: jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/util SystemLogHandler.java

2003-10-28 Thread kinman
kinman  2003/10/28 11:18:54

  Modified:jasper2/src/share/org/apache/jasper/compiler Compiler.java
JspRuntimeContext.java
   jasper2/src/share/org/apache/jasper/util
SystemLogHandler.java
  Log:
  - Patch by [EMAIL PROTECTED]
  
Fix 24186: Jasper SystemLogHandler memory leak
  
  Revision  ChangesPath
  1.72  +0 -6  
jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/compiler/Compiler.java
  
  Index: Compiler.java
  ===
  RCS file: 
/home/cvs/jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/compiler/Compiler.java,v
  retrieving revision 1.71
  retrieving revision 1.72
  diff -u -r1.71 -r1.72
  --- Compiler.java 1 Oct 2003 22:44:02 -   1.71
  +++ Compiler.java 28 Oct 2003 19:18:53 -  1.72
  @@ -98,12 +98,6 @@
   // - Static
   
   
  -static {
  -
  -System.setErr(new SystemLogHandler(System.err));
  -
  -}
  -
   // Some javac are not thread safe; use a lock to serialize compilation, 
   static Object javacLock = new Object();
   
  
  
  
  1.17  +11 -5 
jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/compiler/JspRuntimeContext.java
  
  Index: JspRuntimeContext.java
  ===
  RCS file: 
/home/cvs/jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/compiler/JspRuntimeContext.java,v
  retrieving revision 1.16
  retrieving revision 1.17
  diff -u -r1.16 -r1.17
  --- JspRuntimeContext.java2 Sep 2003 21:39:58 -   1.16
  +++ JspRuntimeContext.java28 Oct 2003 19:18:53 -  1.17
  @@ -82,6 +82,7 @@
   import org.apache.jasper.Constants;
   import org.apache.jasper.JspCompilationContext;
   import org.apache.jasper.Options;
  +import org.apache.jasper.util.SystemLogHandler;
   import org.apache.jasper.runtime.JspFactoryImpl;
   import org.apache.jasper.security.SecurityClassLoad;
   import org.apache.jasper.servlet.JspServletWrapper;
  @@ -125,6 +126,8 @@
*/
   public JspRuntimeContext(ServletContext context, Options options) {
   
  +System.setErr(new SystemLogHandler(System.err));
  +
   this.context = context;
   this.options = options;
   
  @@ -271,7 +274,10 @@
   /**
* Process a destory event for this web application context.
*/
  -public void destroy() {
  +public void destroy() {
  +
  +if(System.err instanceof SystemLogHandler)
  +System.setErr(((SystemLogHandler)System.err).getWrapped());
   
   threadStop();
   
  
  
  
  1.3   +7 -3  
jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/util/SystemLogHandler.java
  
  Index: SystemLogHandler.java
  ===
  RCS file: 
/home/cvs/jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/util/SystemLogHandler.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- SystemLogHandler.java 2 Sep 2003 21:40:00 -   1.2
  +++ SystemLogHandler.java 28 Oct 2003 19:18:54 -  1.3
  @@ -79,7 +79,7 @@
*/
   public SystemLogHandler(PrintStream wrapped) {
   super(wrapped);
  -out = wrapped;
  +this.wrapped = wrapped;
   }
   
   
  @@ -89,7 +89,7 @@
   /**
* Wrapped PrintStream.
*/
  -protected PrintStream out = null;
  +protected PrintStream wrapped = null;
   
   
   /**
  @@ -107,6 +107,10 @@
   // - Public Methods
   
   
  +public PrintStream getWrapped() {
  +  return wrapped;
  +}
  +
   /**
* Start capturing thread's output.
*/
  @@ -142,7 +146,7 @@
   protected PrintStream findStream() {
   PrintStream ps = (PrintStream) streams.get(Thread.currentThread());
   if (ps == null) {
  -ps = out;
  +ps = wrapped;
   }
   return ps;
   }
  
  
  

-
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 TextOptimizer.java Compiler.java Node.java Parser.java

2003-10-28 Thread kinman
kinman  2003/10/28 15:04:11

  Modified:jasper2/src/share/org/apache/jasper/compiler Compiler.java
Node.java Parser.java
  Added:   jasper2/src/share/org/apache/jasper/compiler
TextOptimizer.java
  Log:
  - Concatenate text strings of adjecent TemplateText nodes.  This may
reduce code size and improve performance.
  - Remove previous implementation for mappedfile options from Parser,
since this functionality works for free now.
  
  Revision  ChangesPath
  1.73  +3 -0  
jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/compiler/Compiler.java
  
  Index: Compiler.java
  ===
  RCS file: 
/home/cvs/jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/compiler/Compiler.java,v
  retrieving revision 1.72
  retrieving revision 1.73
  diff -u -r1.72 -r1.73
  --- Compiler.java 28 Oct 2003 19:18:53 -  1.72
  +++ Compiler.java 28 Oct 2003 23:04:11 -  1.73
  @@ -267,6 +267,9 @@
TagPluginManager tagPluginManager = options.getTagPluginManager();
tagPluginManager.apply(pageNodes, errDispatcher, pageInfo);
   
  +// Optimization: concatenate contiguous template texts.
  +TextOptimizer.concatenate(pageNodes);
  +
// Generate static function mapper codes.
ELFunctionMapper.map(this, pageNodes);
   
  
  
  
  1.78  +7 -3  
jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/compiler/Node.java
  
  Index: Node.java
  ===
  RCS file: 
/home/cvs/jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/compiler/Node.java,v
  retrieving revision 1.77
  retrieving revision 1.78
  diff -u -r1.77 -r1.78
  --- Node.java 16 Sep 2003 17:46:43 -  1.77
  +++ Node.java 28 Oct 2003 23:04:11 -  1.78
  @@ -1943,6 +1943,10 @@
   text = text.substring(index);
   }
   
  +public void setText(String text) {
  +this.text = text;
  +}
  +
   /**
* Trim all whitespace from the right of the template text
*/
  
  
  
  1.83  +5 -44 
jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/compiler/Parser.java
  
  Index: Parser.java
  ===
  RCS file: 
/home/cvs/jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/compiler/Parser.java,v
  retrieving revision 1.82
  retrieving revision 1.83
  diff -u -r1.82 -r1.83
  --- Parser.java   23 Sep 2003 20:47:23 -  1.82
  +++ Parser.java   28 Oct 2003 23:04:11 -  1.83
  @@ -101,7 +101,6 @@
   private boolean directivesOnly;
   private URL jarFileUrl;
   private PageInfo pageInfo;
  -private boolean mappedFile;
   
   // Virtual body content types, to make parsing a little easier.
   // These are not accessible from outside the parser.
  @@ -128,7 +127,6 @@
this.directivesOnly = directivesOnly;
this.jarFileUrl = jarFileUrl;
   start = reader.mark();
  -mappedFile = ctxt.getOptions().getMappedFile();
   }
   
   /**
  @@ -1409,44 +1407,9 @@
return true;
   }
   
  -/**
  - * Determines whether the current text is template text
  - * or not.  Assumes the reader is at the character 
  - * following the .
  - */
  -private boolean isTemplateText() throws JasperException {
  -
  -Mark m = reader.mark();
  -int ch = reader.peekChar();
  -if (ch == '/') {
  -reader.nextChar();
  -}
  -String tagIdentifier = reader.parseToken(false);
  -reader.reset(m);
  -
  -if (tagIdentifier.startsWith(%)) {
  -return false;
  -}
  -if (tagIdentifier.startsWith(jsp:)) {
  -return false;
  -}
  -
  -// Check if this is a user-defined tag.
  -int i = tagIdentifier.indexOf(':');
  -if (i == -1) {
  -return true;
  -}
  -String prefix = tagIdentifier.substring(0, i);
  -String uri = pageInfo.getURI(prefix);
  -if (uri == null) {
  -return true;
  -}
  -
  -return false;
  -}
  -
   /*
  - *
  + * Parse for a template text string until '' or ${ is encountered, 
  + * recognizing escape sequences \% and \$.
*/
   private void parseTemplateText(Node parent) throws JasperException {
   
  @@ -1461,11 +1424,9 @@
while (reader.hasMoreInput()) {
ch = reader.nextChar();
if (ch == '') {
  -if (!mappedFile || !isTemplateText()) {
   reader.pushChar();
   break;
   }
  - }
else if( ch == '$' ) {
if (!reader.hasMoreInput()) {
ttext.write('$');
  
  
  
  1.1

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

2003-10-22 Thread kinman
kinman  2003/10/22 12:10:58

  Modified:jasper2/src/share/org/apache/jasper/compiler SmapUtil.java
  Log:
  - Make Smap's FileSection work for windows too.
  
  Revision  ChangesPath
  1.20  +2 -1  
jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/compiler/SmapUtil.java
  
  Index: SmapUtil.java
  ===
  RCS file: 
/home/cvs/jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/compiler/SmapUtil.java,v
  retrieving revision 1.19
  retrieving revision 1.20
  diff -u -r1.19 -r1.20
  --- SmapUtil.java 16 Sep 2003 17:46:43 -  1.19
  +++ SmapUtil.java 22 Oct 2003 19:10:58 -  1.20
  @@ -160,7 +160,8 @@
* Returns an unqualified version of the given file path.
*/
   private static String unqualify(String path) {
  -return path.substring(path.lastIndexOf(File.separator) + 1);
  +path = path.replace('\\', '/');
  +return path.substring(path.lastIndexOf('/') + 1);
   }
   
   /**
  
  
  

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

2003-10-22 Thread kinman
kinman  2003/10/22 16:52:55

  Modified:jasper2/src/share/org/apache/jasper/compiler
DefaultErrorHandler.java
  Log:
  - Make sure that the No Java compiler error message is produced only when
there is really no javac.  This also fixes 24019
  
  Revision  ChangesPath
  1.8   +4 -5  
jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/compiler/DefaultErrorHandler.java
  
  Index: DefaultErrorHandler.java
  ===
  RCS file: 
/home/cvs/jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/compiler/DefaultErrorHandler.java,v
  retrieving revision 1.7
  retrieving revision 1.8
  diff -u -r1.7 -r1.8
  --- DefaultErrorHandler.java  8 Jul 2003 22:53:38 -   1.7
  +++ DefaultErrorHandler.java  22 Oct 2003 23:52:55 -  1.8
  @@ -106,8 +106,7 @@
   StringBuffer buf = new StringBuffer();

   if ((details.length == 1) 
  - (details[0].getJspBeginLineNumber() == -1)
  - (details[0].getJspFileName() == null)) {
  + (details[0].getJavaLineNumber() == -1)) {
   // Special case: No Java compiler found
   buf.append(Localizer.getMessage(jsp.error.nojavac));
   buf.append('\n');
  
  
  

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

2003-10-20 Thread kinman
kinman  2003/10/20 14:07:46

  Modified:jasper2/src/share/org/apache/jasper/compiler Generator.java
  Log:
  - Tweak the SMAP tracking code so that it works for classic custom tag and
JSP fragments.  This also fixes bug 23691.
  
  Revision  ChangesPath
  1.214 +48 -28
jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/compiler/Generator.java
  
  Index: Generator.java
  ===
  RCS file: 
/home/cvs/jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/compiler/Generator.java,v
  retrieving revision 1.213
  retrieving revision 1.214
  diff -u -r1.213 -r1.214
  --- Generator.java10 Oct 2003 17:40:38 -  1.213
  +++ Generator.java20 Oct 2003 21:07:46 -  1.214
  @@ -1629,8 +1629,13 @@
   
   // Set up new buffer for the method
   outSave = out;
  +/* For fragments, their bodies will be generated in fragment
  +   helper classes, and the Java line adjustments will be done
  +   there, hence they are set to null here to avoid double
  +   adjustments.
  +*/
   GenBuffer genBuffer =
  -new GenBuffer(n.implementsSimpleTag() ? null : n);
  +new GenBuffer(n, n.implementsSimpleTag()? null: n.getBody());
   methodsBuffered.add(genBuffer);
   out = genBuffer.getOut();
   
  @@ -1883,7 +1888,7 @@
  // Generate Strings as char arrays, for performance
   ServletWriter caOut;
   if (charArrayBuffer == null) {
  -charArrayBuffer = new GenBuffer(null);
  +charArrayBuffer = new GenBuffer();
   caOut = charArrayBuffer.getOut();
   caOut.pushIndent();
   textMap = new HashMap();
  @@ -3694,21 +3699,31 @@
   }
   
   /**
  - * A class for generating codes to a buffer.
  + * A class for generating codes to a buffer.  Included here are some
  + * support for tracking source to Java lines mapping.
*/
   private static class GenBuffer {
   
  +/*
  + * For a CustomTag, the codes that are generated at the beginning of
  + * the tag may not be in the same buffer as those for the body of the
  + * tag.  Two fields are used here to keep this straight.  For codes
  + * that do not corresponds to any JSP lines, they should be null.  
  + */
   private Node node;
  +private Node.Nodes body;
   private java.io.CharArrayWriter charWriter;
   protected ServletWriter out;
   
  -GenBuffer(Node n) {
  +GenBuffer() {
  +this(null, null);
  +}
  +
  +GenBuffer(Node n, Node.Nodes b) {
   node = n;
  -if (n != null) {
  -Node.Nodes body = n.getBody();
  -if (body != null) {
  -body.setGeneratedInBuffer(true);
  -}
  +body = b;
  +if (body != null) {
  +body.setGeneratedInBuffer(true);
   }
   charWriter = new java.io.CharArrayWriter();
   out = new ServletWriter(new java.io.PrintWriter(charWriter));
  @@ -3731,27 +3746,25 @@
   public void adjustJavaLines(final int offset) {
   
   if (node != null) {
  +adjustJavaLine(node, offset);
  +}
  +
  +if (body != null) {
   try {
  -node.accept(new Node.Visitor() {
  +body.visit(new Node.Visitor() {
   
   public void doVisit(Node n) {
  -if (n.getBeginJavaLine()  0) {
  -n.setBeginJavaLine(
  -n.getBeginJavaLine() + offset);
  -n.setEndJavaLine(n.getEndJavaLine() + offset);
  -}
  +adjustJavaLine(n, offset);
   }
   
   public void visit(Node.CustomTag n)
   throws JasperException {
  -doVisit(n);
  -Node.Nodes body = n.getBody();
  -if (body != null 
  -((node == n) || !body.isGeneratedInBuffer())) {
  -// We want to adjust the Java lines only for
  -// top level Custom tags, unless its body is
  -// not generated in a buffer.
  -body.visit(this);
  +Node.Nodes b = n.getBody();
  +if (b != null  !b.isGeneratedInBuffer

cvs commit: jakarta-tomcat-connectors/util/java/org/apache/tomcat/util/buf CharChunk.java

2003-10-16 Thread kinman
kinman  2003/10/16 16:53:03

  Modified:util/java/org/apache/tomcat/util/buf CharChunk.java
  Log:
  - Avoid some copying on a common case, when a JSP page is flushing its
own buffer.
  
  Revision  ChangesPath
  1.9   +9 -1  
jakarta-tomcat-connectors/util/java/org/apache/tomcat/util/buf/CharChunk.java
  
  Index: CharChunk.java
  ===
  RCS file: 
/home/cvs/jakarta-tomcat-connectors/util/java/org/apache/tomcat/util/buf/CharChunk.java,v
  retrieving revision 1.8
  retrieving revision 1.9
  diff -u -r1.8 -r1.9
  --- CharChunk.java2 Sep 2003 21:34:38 -   1.8
  +++ CharChunk.java16 Oct 2003 23:53:03 -  1.9
  @@ -290,6 +290,14 @@
end+=len;
return;
}
  +
  +// Optimize on a common case.
  +// If the source is going to fill up all the space in buffer, may
  +// as well write it directly to the output, and avoid an extra copy
  +if ( len == limit  end == 0) {
  +out.realWriteChars( src, off, len );
  +return;
  +}

// if we have limit and we're below
if( len = limit - end ) {
  @@ -487,7 +495,7 @@
   
// limit  buf.length ( the buffer is already big )
// or we already have space XXX
  - if( desiredSize  buff.length ) {
  + if( desiredSize = buff.length ) {
return;
}
// grow in larger chunks
  
  
  

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



cvs commit: jakarta-servletapi-5/jsr152/src/share/dtd web-jsptaglibrary_2_0.xsd

2003-10-09 Thread kinman
kinman  2003/10/09 09:13:30

  Modified:jsr152/src/share/dtd web-jsptaglibrary_2_0.xsd
  Log:
  - Patch by Mark Roth
  
  Remove a superfluous definition for the xml prefix.
  
  Revision  ChangesPath
  1.15  +11 -9 
jakarta-servletapi-5/jsr152/src/share/dtd/web-jsptaglibrary_2_0.xsd
  
  Index: web-jsptaglibrary_2_0.xsd
  ===
  RCS file: 
/home/cvs/jakarta-servletapi-5/jsr152/src/share/dtd/web-jsptaglibrary_2_0.xsd,v
  retrieving revision 1.14
  retrieving revision 1.15
  diff -u -r1.14 -r1.15
  --- web-jsptaglibrary_2_0.xsd 18 Aug 2003 19:58:19 -  1.14
  +++ web-jsptaglibrary_2_0.xsd 9 Oct 2003 16:13:29 -   1.15
  @@ -3,7 +3,6 @@
targetNamespace=http://java.sun.com/xml/ns/j2ee;
xmlns:j2ee=http://java.sun.com/xml/ns/j2ee;
xmlns:xsd=http://www.w3.org/2001/XMLSchema;
  - xmlns:xml=http://www.w3.org/XML/1998/namespace;
elementFormDefault=qualified
attributeFormDefault=unqualified
version=2.0
  @@ -13,10 +12,11 @@
 %W% %G%
   /xsd:documentation
 /xsd:annotation
  +
 xsd:annotation
   xsd:documentation
   
  -  Copyright 2002 Sun Microsystems, Inc., 901 San Antonio
  +  Copyright 2003 Sun Microsystems, Inc., 901 San Antonio
 Road, Palo Alto, California 94303, U.S.A. All rights
 reserved.
   
  @@ -270,13 +270,15 @@
   
Where:
   
  - * Type is a basic type or a fully qualified Java class name
  -   (including package name), as per the 'Type' production
  -   in the Java Language Specification, Second Edition,
  + * Type is a basic type or a fully qualified
  +   Java class name (including package name),
  +   as per the 'Type' production in the Java
  +   Language Specification, Second Edition,
  Chapter 18.
   
  -* Identifier is a Java identifier, as per the 'Identifier'
  -   production in the Java Language Specification, Second
  +* Identifier is a Java identifier, as per
  +   the 'Identifier' production in the Java
  +   Language Specification, Second
  Edition, Chapter 18.
   
Example:
  @@ -693,8 +695,8 @@
   
The taglib tag is the document root, it defines:
   
  - description a simple string describing the use of this taglib,
  - should be user discernable
  + description a simple string describing the use of this
  + taglib, should be user discernable
   
display-namethe display-name element contains a
short name that is intended to be displayed
  
  
  

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



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

2003-10-08 Thread kinman
kinman  2003/10/08 10:39:15

  Modified:jasper2/src/share/org/apache/jasper
JspCompilationContext.java
  Log:
  - Serialize directory creating to avoid a potential race condition.
  
  Revision  ChangesPath
  1.43  +21 -19
jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/JspCompilationContext.java
  
  Index: JspCompilationContext.java
  ===
  RCS file: 
/home/cvs/jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/JspCompilationContext.java,v
  retrieving revision 1.42
  retrieving revision 1.43
  diff -u -r1.42 -r1.43
  --- JspCompilationContext.java30 Jul 2003 17:33:14 -  1.42
  +++ JspCompilationContext.java8 Oct 2003 17:39:15 -   1.43
  @@ -1,5 +1,6 @@
   /*
  - * $Header$
  + * $Header: /home/cvs/jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/
  +JspCompilationContext.java,v 1.42 2003/07/30 17:33:14 kinman Exp $
* $Revision$
* $Date$
*
  @@ -423,10 +424,8 @@
   servletJavaFileName =
getOutputDir() + getServletClassName() + .java;
   } else {
  -File outDirFile = new File(outputDir);
  -if (!outDirFile.exists()) {
  -outDirFile.mkdirs();
  -}
  +// Make sure output dir exists
  +makeOutputDir();
   }
   return servletJavaFileName;
   }
  @@ -474,10 +473,8 @@
   if (classFileName == null) {
   classFileName = getOutputDir() + getServletClassName() + .class;
   } else {
  -File outDirFile = new File(outputDir);
  -if (!outDirFile.exists()) {
  -outDirFile.mkdirs();
  -}
  +// Make sure output dir exists
  +makeOutputDir();
   }
   return classFileName;
   }
  @@ -594,8 +591,18 @@
   return servletClass;
   }
   
  -private void createOutputDir() {
  +//  Private methods  
   
  +static Object outputDirLock = new Object();
  +
  +private void makeOutputDir() {
  +synchronized(outputDirLock) {
  +File outDirFile = new File(outputDir);
  +outDirFile.mkdirs();
  +}
  +}
  +
  +private void createOutputDir() {
   String path = null;
   if (isTagFile()) {
String tagName = tagInfo.getTagClassName();
  @@ -610,19 +617,14 @@
   baseUrl = options.getScratchDir().toURL();
   String outUrlString = baseUrl.toString() + '/' + path;
   URL outUrl = new URL(outUrlString);
  -File outDirFile = new File(outUrl.getFile());
  -if (!outDirFile.exists()) {
  -outDirFile.mkdirs();
  -}
  -outputDir = outDirFile.toString() + File.separator;
  +outputDir = outUrl.getFile() + File.separator;
  +makeOutputDir();
   } catch (Exception e) {
   throw new IllegalStateException(No output directory:  +
   e.getMessage());
   }
   }
   
  -//  Private methods  
  -
   private static final boolean isPathSeparator(char c) {
  return (c == '/' || c == '\\');
   }
  
  
  

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



cvs commit: jakarta-servletapi-5/jsr152/src/ant - New directory

2003-10-03 Thread kinman
kinman  2003/10/03 13:16:02

  jakarta-servletapi-5/jsr152/src/ant - New directory

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



cvs commit: jakarta-servletapi-5/jsr152/src/ant/task - New directory

2003-10-03 Thread kinman
kinman  2003/10/03 13:16:26

  jakarta-servletapi-5/jsr152/src/ant/task - New directory

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



cvs commit: jakarta-servletapi-5/jsr152/src/ant/task Txt2Html.java

2003-10-03 Thread kinman
kinman  2003/10/03 13:18:07

  Modified:jsr152   build.xml
   jsr152/examples/cal calendar.html
   jsr152/examples/checkbox cresult.html
   jsr152/examples/colors clr.html
   jsr152/examples/dates date.html
   jsr152/examples/error er.html
   jsr152/examples/forward fwd.html
   jsr152/examples/include inc.html
   jsr152/examples/jsp2/el basic-arithmetic.html
basic-comparisons.html functions.html
implicit-objects.html
   jsr152/examples/jsp2/jspattribute jspattribute.html
shuffle.html
   jsr152/examples/jsp2/jspx basic.html textRotate.html
   jsr152/examples/jsp2/misc config.html dynamicattrs.html
   jsr152/examples/jsp2/simpletag book.html hello.html
repeat.html
   jsr152/examples/jsp2/tagfiles hello.html panel.html
products.html
   jsr152/examples/jsptoserv jts.html
   jsr152/examples/num numguess.html
   jsr152/examples/plugin plugin.html plugin.jsp
   jsr152/examples/sessions crt.html
   jsr152/examples/simpletag foo.html
   jsr152/examples/snp snoop.html
   jsr152/examples/xml xml.html
  Added:   jsr152/src/ant/task Txt2Html.java
  Log:
  - Patch by Mark Roth:
  
  There were reports of the View Source option not working for the JSP
  examples in some versions of IE.  Apparently some configurations of IE
  will process the HTML tags in text files instead of rendering them as
  text.  I've made the following enhancements:
  
 * Created new ant task Txt2Html that converts text files to
   escaped HTML in a 'pre' tag
 * Modified build.xml to build and import Txt2Html task
 * Modified build.xml to generate foo.jsp.html instead of foo.jsp.txt
   using new Txt2Html task
 * Updated example HTML files to refer to foo.jsp.html instead of
   foo.jsp.txt
 * Fixed some broken links and broken image links in some HTML files
 * Fixed plugin example to use relative path name to applet codebase
   instead of absolute path
  
  Revision  ChangesPath
  1.8   +34 -37jakarta-servletapi-5/jsr152/build.xml
  
  Index: build.xml
  ===
  RCS file: /home/cvs/jakarta-servletapi-5/jsr152/build.xml,v
  retrieving revision 1.7
  retrieving revision 1.8
  diff -u -r1.7 -r1.8
  --- build.xml 1 May 2003 22:39:50 -   1.7
  +++ build.xml 3 Oct 2003 20:18:06 -   1.8
  @@ -33,6 +33,7 @@
   mkdir dir=${jsp-api.build}/docs/
   mkdir dir=${jsp-api.build}/docs/api/
   mkdir dir=${jsp-api.build}/examples/
  +mkdir dir=${jsp-api.build}/ant/
   
   !-- Dist Hierarchy --
   mkdir dir=${jsp-api.dist}/
  @@ -106,8 +107,17 @@
 /target
   
   
  -  !--  Build JavaDoc === --
  -  target name=examples depends=prepare
  +  !--  Build Examples === --
  +  target name=ant depends=prepare
  +javac  srcdir=src/ant destdir=${jsp-api.build}/ant
  +debug=${compile.debug} deprecation=${compile.deprecation}
  +optimize=${compile.optimize} 
  +classpath=${ant.home}/lib/ant.jar /
  +taskdefname=txt2html classname=task.Txt2Html
  +classpath=${jsp-api.build}/ant /
  +  /target
  +  
  +  target name=examples depends=prepare,ant
   
   copy todir=${jsp-api.build}/examples
 fileset dir=examples
  @@ -115,7 +125,7 @@
 /fileset
   /copy
   
  -copy todir=${jsp-api.build}/examples/jsp2/simpletag
  +txt2html todir=${jsp-api.build}/examples/jsp2/simpletag
 fileset dir=examples/WEB-INF/classes/jsp2/examples
   include name=BookBean.java/
 /fileset
  @@ -127,10 +137,9 @@
 fileset dir=examples/WEB-INF/classes/jsp2/examples/el
   include name=Functions.java/
 /fileset
  -  mapper type=glob from=*.java to=*.java.txt/
  -/copy
  +/txt2html
   
  -copy todir=${jsp-api.build}/examples/jsp2/jspattribute
  +txt2html todir=${jsp-api.build}/examples/jsp2/jspattribute
 fileset dir=examples/WEB-INF/classes/jsp2/examples
   include name=FooBean.java/
 /fileset
  @@ -139,47 +148,46 @@
   include name=TileSimpleTag.java/
   include name=HelloWorldSimpleTag.java/
 /fileset
  -  mapper type=glob from=*.java to=*.java.txt/
  -/copy
  +/txt2html
   
  -copy todir=${jsp-api.build}/examples/cal
  +txt2html todir=${jsp-api.build}/examples/cal
 fileset dir=examples/WEB-INF/classes/cal
   include name=Entries.java/
   include name=Entry.java/
   include name=JspCalendar.java/
   include name=TableBean.java

cvs commit: jakarta-tomcat-jasper/jasper2/src/bin jasper.sh

2003-10-01 Thread kinman
kinman  2003/10/01 11:39:08

  Modified:jasper2/src/bin jasper.sh
  Log:
  - Get the script to work.
  
  Revision  ChangesPath
  1.6   +3 -1  jakarta-tomcat-jasper/jasper2/src/bin/jasper.sh
  
  Index: jasper.sh
  ===
  RCS file: /home/cvs/jakarta-tomcat-jasper/jasper2/src/bin/jasper.sh,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- jasper.sh 21 Feb 2003 18:23:14 -  1.5
  +++ jasper.sh 1 Oct 2003 18:39:08 -   1.6
  @@ -19,8 +19,10 @@
   
   # OS specific support.  $var _must_ be set to either true or false.
   cygwin=false
  +os400=false
   case `uname` in
   CYGWIN*) cygwin=true;;
  +OS400*) os400=true;;
   esac
   
   # resolve links - $0 may be a softlink
  
  
  

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

2003-10-01 Thread kinman
kinman  2003/10/01 15:44:02

  Modified:jasper2/src/share/org/apache/jasper/compiler Compiler.java
  Log:
  - Some Javadoc improvements.
  
  Revision  ChangesPath
  1.71  +15 -13
jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/compiler/Compiler.java
  
  Index: Compiler.java
  ===
  RCS file: 
/home/cvs/jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/compiler/Compiler.java,v
  retrieving revision 1.70
  retrieving revision 1.71
  diff -u -r1.70 -r1.71
  --- Compiler.java 26 Sep 2003 23:19:32 -  1.70
  +++ Compiler.java 1 Oct 2003 22:44:02 -   1.71
  @@ -188,7 +188,7 @@
   
   
   /** 
  - * Compile the jsp file from the current engine context
  + * Compile the jsp file into equivalent servlet in .java file
* @return a smap for the current JSP page, if one is generated,
* null otherwise
*/
  @@ -249,10 +249,6 @@
return null;
}
   
  - // Generate FunctionMapper (used for validation of EL expressions and
  - // code generation)
  - // pageInfo.setFunctionMapper(new FunctionMapperImpl(this));
  -
// Validate and process attributes
Validator.validate(this, pageNodes);
   
  @@ -294,7 +290,7 @@
 (t4-t1) +  generate= + ( t4-t3 ) +  validate= + ( t2-t1 
));
   }
   
  -//JSR45 Support - note this needs to be checked by a JSR45 guru
  +// JSR45 Support
   if (! options.isSmapSuppressed()) {
   smapStr = SmapUtil.generateSmap(ctxt, pageNodes);
   }
  @@ -311,7 +307,7 @@
   }
   
   /** 
  - * Compile the jsp file from the current engine context
  + * Compile the servlet from .java file to .class file
*/
   private void generateClass(String smap)
   throws FileNotFoundException, JasperException, Exception {
  @@ -431,7 +427,7 @@
return;
}
   
  -//JSR45 Support - note this needs to be checked by a JSR45 guru
  +// JSR45 Support
   if (! options.isSmapSuppressed()) {
   SmapUtil.installSmap(ctxt.getClassFileName(), smap);
   }
  @@ -447,7 +443,10 @@
   }
   
   /**
  - * Compile the jsp file from the current engine context
  + * Compile the jsp file from the current engine context.  As an side-
  + * effect, tag files that are referenced by this page are also compiled.
  + * @param compileClass If true, generate both .java and .class file
  + * If false, generate only .java file
*/
   public void compile(boolean compileClass)
   throws FileNotFoundException, JasperException, Exception
  @@ -492,10 +491,13 @@
   }
   
   /**
  - * This is a protected method intended to be overridden by 
  - * subclasses of Compiler. This is used by the compile method
  - * to do all the compilation.
  - * @param checkClass Verify the class file if true, only the .java file if 
false.
  + * Determine if a compilation is necessary by checking the time stamp
  + * of the JSP page with that of the corresponding .class or .java file.
  + * If the page has dependencies, the check is also extended to its
  + * dependeants, and so on.
  + * This method can by overidden by a subclasses of Compiler.
  + * @param checkClass If true, check against .class file,
  + *   if false, check against .java file.
*/
   public boolean isOutDated(boolean checkClass) {
   
  
  
  

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

2003-09-26 Thread kinman
kinman  2003/09/26 16:19:32

  Modified:jasper2/src/share/org/apache/jasper/compiler Compiler.java
  Log:
  - Support java extension direcotries when invoking javac.
  
  Revision  ChangesPath
  1.70  +12 -3 
jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/compiler/Compiler.java
  
  Index: Compiler.java
  ===
  RCS file: 
/home/cvs/jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/compiler/Compiler.java,v
  retrieving revision 1.69
  retrieving revision 1.70
  diff -u -r1.69 -r1.70
  --- Compiler.java 24 Aug 2003 01:18:44 -  1.69
  +++ Compiler.java 26 Sep 2003 23:19:32 -  1.70
  @@ -340,13 +340,13 @@
   // Initializing classpath
   Path path = new Path(project);
   path.setPath(System.getProperty(java.class.path));
  -info.append( cp= + System.getProperty(java.class.path) + \n);
  +info.append(cp= + System.getProperty(java.class.path) + \n);
   StringTokenizer tokenizer = new StringTokenizer(classpath, sep);
   while (tokenizer.hasMoreElements()) {
   String pathElement = tokenizer.nextToken();
   File repository = new File(pathElement);
   path.setLocation(repository);
  -info.append( cp= + repository + \n);
  +info.append(cp= + repository + \n);
   }
   
   if( log.isDebugEnabled() )
  @@ -357,7 +357,16 @@
   Path srcPath = new Path(project);
   srcPath.setLocation(options.getScratchDir());
   
  -info.append( work dir= + options.getScratchDir() + \n);
  +info.append(work dir= + options.getScratchDir() + \n);
  +
  +// Initialize and set java extensions
  +String exts = System.getProperty(java.ext.dirs);
  +if (exts != null) {
  +Path extdirs = new Path(project);
  +extdirs.setPath(exts);
  +javac.setExtdirs(extdirs);
  +info.append(extension dir= + exts + \n);
  +}
   
   // Configure the compiler object
   javac.setEncoding(javaEncoding);
  
  
  

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



cvs commit: jakarta-servletapi-5/jsr154/src/share/dtd j2ee_1_4.xsd

2003-09-25 Thread kinman
kinman  2003/09/25 15:33:18

  Modified:jsr154/src/share/dtd j2ee_1_4.xsd
  Log:
  Patch by Mark Roth:
  
  - update the J2EE 1.4 schema jsr154/src/share/dtd/j2ee_1_4.xsd
to clarify that fully-qualified-classType is a binary name
  
  Revision  ChangesPath
  1.10  +6 -2  jakarta-servletapi-5/jsr154/src/share/dtd/j2ee_1_4.xsd
  
  Index: j2ee_1_4.xsd
  ===
  RCS file: /home/cvs/jakarta-servletapi-5/jsr154/src/share/dtd/j2ee_1_4.xsd,v
  retrieving revision 1.9
  retrieving revision 1.10
  diff -u -r1.9 -r1.10
  --- j2ee_1_4.xsd  18 Aug 2003 17:41:20 -  1.9
  +++ j2ee_1_4.xsd  25 Sep 2003 22:33:18 -  1.10
  @@ -8,7 +8,7 @@
version=1.4
 xsd:annotation
   xsd:documentation
  -  @(#)j2ee_1_4.xsds  1.42 03/08/01
  +  @(#)j2ee_1_4.xsds  1.43 03/09/16
   /xsd:documentation
 /xsd:annotation
   
  @@ -497,7 +497,11 @@
 xsd:documentation
   
The elements that use this type designate the name of a
  - Java class or interface.
  + Java class or interface.  The name is in the form of a
  + binary name, as defined in the JLS.  This is the form
  + of name used in Class.forName().  Tools that need the
  + canonical name (the name used in source code) will need
  + to convert this binary name to the canonical name.
   
 /xsd:documentation
   /xsd:annotation
  
  
  

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

2003-09-23 Thread kinman
kinman  2003/09/23 13:47:23

  Modified:jasper2/src/share/org/apache/jasper/compiler Parser.java
  Log:
  - Fix bug: \%foo% in template text hides expression.
  
  Revision  ChangesPath
  1.82  +10 -7 
jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/compiler/Parser.java
  
  Index: Parser.java
  ===
  RCS file: 
/home/cvs/jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/compiler/Parser.java,v
  retrieving revision 1.81
  retrieving revision 1.82
  diff -u -r1.81 -r1.82
  --- Parser.java   23 Sep 2003 00:08:22 -  1.81
  +++ Parser.java   23 Sep 2003 20:47:23 -  1.82
  @@ -1486,10 +1486,13 @@
ttext.write('\\');
break;
}
  - ch = reader.nextChar();
  - // Looking for \% or \$
  - if (ch != '%'  ch != '$') {
  - ttext.write('\\');
  +char next = (char)reader.peekChar();
  +// Looking for \% or \$
  +// TODO: only recognize \$ if isELIgnored is false, but since
  +// it can be set in a page directive, it cannot be determined
  +// here.  Argh!
  +if (next == '%' || next == '$') {
  +ch = reader.nextChar();
   }
}
ttext.write(ch);
  
  
  

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

2003-09-22 Thread kinman
kinman  2003/09/22 17:08:22

  Modified:jasper2/src/share/org/apache/jasper/compiler Parser.java
  Log:
  - Fix a bug in Parser.isTemplateText():
  
Since '%' is not a delimiter in JspReader.parseToken(), an expression
%String s;% after a template text would be treated as a template
text when mappedfile option is set to true, and got concatenated to
the template text.
  
  Revision  ChangesPath
  1.81  +4 -16 
jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/compiler/Parser.java
  
  Index: Parser.java
  ===
  RCS file: 
/home/cvs/jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/compiler/Parser.java,v
  retrieving revision 1.80
  retrieving revision 1.81
  diff -u -r1.80 -r1.81
  --- Parser.java   2 Sep 2003 21:39:59 -   1.80
  +++ Parser.java   23 Sep 2003 00:08:22 -  1.81
  @@ -1424,19 +1424,7 @@
   String tagIdentifier = reader.parseToken(false);
   reader.reset(m);
   
  -if (tagIdentifier.equals(%--)) {
  -return false;
  -}
  -if (tagIdentifier.equals(%@)) {
  -return false;
  -}
  -if (tagIdentifier.equals(%!)) {
  -return false;
  -}
  -if (tagIdentifier.equals(%=)) {
  -return false;
  -}
  -if (tagIdentifier.equals(%)) {
  +if (tagIdentifier.startsWith(%)) {
   return false;
   }
   if (tagIdentifier.startsWith(jsp:)) {
  
  
  

-
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 Generator.java JspUtil.java

2003-09-19 Thread kinman
kinman  2003/09/19 11:30:10

  Modified:jasper2/src/share/org/apache/jasper/compiler Generator.java
JspUtil.java
  Log:
  - When a tag handler class is an inner class, it is specified in the TLD
in binary form (Outer$Inner).  It needs to be converted to canonical
form (Outer.Inner) when generating Java files.
  
  Revision  ChangesPath
  1.210 +21 -15
jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/compiler/Generator.java
  
  Index: Generator.java
  ===
  RCS file: 
/home/cvs/jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/compiler/Generator.java,v
  retrieving revision 1.209
  retrieving revision 1.210
  diff -u -r1.209 -r1.210
  --- Generator.java18 Sep 2003 23:12:39 -  1.209
  +++ Generator.java19 Sep 2003 18:30:09 -  1.210
  @@ -1048,7 +1048,7 @@
   if (beanInfo.checkVariable(name)) {
   // Bean is defined using useBean, introspect at compile time
   Class bean = beanInfo.getBeanType(name);
  -String beanName = bean.getName();
  +String beanName = JspUtil.getCanonicalName(bean);
   java.lang.reflect.Method meth =
   JspRuntimeLibrary.getReadMethod(bean, property);
   String methodName = meth.getName();
  @@ -2121,21 +2121,23 @@
   declareScriptingVars(n, VariableInfo.AT_BEGIN);
   saveScriptingVars(n, VariableInfo.AT_BEGIN);
   
  -out.printin(tagHandlerClass.getName());
  +String tagHandlerClassName =
  +JspUtil.getCanonicalName(tagHandlerClass);
  +out.printin(tagHandlerClassName);
   out.print( );
   out.print(tagHandlerVar);
   out.print( = );
   if (isPoolingEnabled) {
   out.print(();
  -out.print(tagHandlerClass.getName());
  +out.print(tagHandlerClassName);
   out.print() );
   out.print(n.getTagHandlerPoolName());
   out.print(.get();
  -out.print(tagHandlerClass.getName());
  +out.print(tagHandlerClassName);
   out.println(.class););
   } else {
   out.print(new );
  -out.print(tagHandlerClass.getName());
  +out.print(tagHandlerClassName);
   out.println((););
   }
   
  @@ -2333,12 +2335,14 @@
   declareScriptingVars(n, VariableInfo.AT_BEGIN);
   saveScriptingVars(n, VariableInfo.AT_BEGIN);
   
  -out.printin(tagHandlerClass.getName());
  +String tagHandlerClassName =
  +JspUtil.getCanonicalName(tagHandlerClass);
  +out.printin(tagHandlerClassName);
   out.print( );
   out.print(tagHandlerVar);
   out.print( = );
   out.print(new );
  -out.print(tagHandlerClass.getName());
  +out.print(tagHandlerClassName);
   out.println((););
   
   generateSetters(n, tagHandlerVar, handlerInfo, true);
  @@ -2853,16 +2857,17 @@
   }
   
   if (propEditorClass != null) {
  +String className = JspUtil.getCanonicalName(c);
   return (
  -+ c.getName()
  ++ className
   + 
)org.apache.jasper.runtime.JspRuntimeLibrary.getValueFromBeanInfoPropertyEditor(
  -+ c.getName()
  ++ className
   + .class, \
   + attrName
   + \, 
   + quoted
   + , 
  -+ propEditorClass.getName()
  ++ JspUtil.getCanonicalName(propEditorClass)
   + .class);
   } else if (c == String.class) {
   return quoted;
  @@ -2901,10 +2906,11 @@
   } else if (c == Object.class) {
   return new String( + quoted + );
   } else {
  +String className = JspUtil.getCanonicalName(c);
   return (
  -+ c.getName()
  ++ className
   + 
)org.apache.jasper.runtime.JspRuntimeLibrary.getValueFromPropertyEditorManager(
  -+ c.getName()
  ++ className
   + .class, \
   + attrName
   + \, 
  
  
  
  1.45  +28 -3 
jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/compiler/JspUtil.java
  
  Index: JspUtil.java
  ===
  RCS file: 
/home/cvs/jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/compiler/JspUtil.java,v

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

2003-09-19 Thread kinman
kinman  2003/09/19 16:38:09

  Modified:jasper2/src/share/org/apache/jasper/compiler Generator.java
  Log:
  - Make sure scriptlet declarations get properly mapped.  This fixes 22833
  
  Revision  ChangesPath
  1.211 +7 -6  
jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/compiler/Generator.java
  
  Index: Generator.java
  ===
  RCS file: 
/home/cvs/jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/compiler/Generator.java,v
  retrieving revision 1.210
  retrieving revision 1.211
  diff -u -r1.210 -r1.211
  --- Generator.java19 Sep 2003 18:30:09 -  1.210
  +++ Generator.java19 Sep 2003 23:38:08 -  1.211
  @@ -196,9 +196,7 @@
*/
   public void visit(Node.PageDirective n) throws JasperException {
   
  -if (!getServletInfoGenerated) {
  -getServletInfoGenerated = true;
  -} else {
  +if (getServletInfoGenerated) {
   return;
   }
   
  @@ -206,6 +204,7 @@
   if (info == null)
   return;
   
  +getServletInfoGenerated = true;
   out.printil(public String getServletInfo() {);
   out.pushIndent();
   out.printin(return );
  @@ -217,8 +216,10 @@
   }
   
   public void visit(Node.Declaration n) throws JasperException {
  +n.setBeginJavaLine(out.getJavaLine());
   out.printMultiLn(new String(n.getText()));
   out.println();
  +n.setEndJavaLine(out.getJavaLine());
   }
   
   // Custom Tags may contain declarations from tag plugins.
  
  
  

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



cvs commit: jakarta-tomcat-catalina/catalina/src/bin setclasspath.sh

2003-09-18 Thread kinman
kinman  2003/09/18 14:04:51

  Modified:catalina/src/bin setclasspath.sh
  Log:
  - Fix so I can debug tomcat on Unix again.
  
  Revision  ChangesPath
  1.6   +2 -2  jakarta-tomcat-catalina/catalina/src/bin/setclasspath.sh
  
  Index: setclasspath.sh
  ===
  RCS file: /home/cvs/jakarta-tomcat-catalina/catalina/src/bin/setclasspath.sh,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- setclasspath.sh   31 Jul 2003 15:17:55 -  1.5
  +++ setclasspath.sh   18 Sep 2003 21:04:51 -  1.6
  @@ -53,7 +53,7 @@
   
   # Set standard commands for invoking Java.
   _RUNJAVA=$JAVA_HOME/bin/java
  -if [ ! $os400 ]; then
  +if [ $os400 = false ]; then
 _RUNJDB=$JAVA_HOME/bin/jdb
   fi
   _RUNJAVAC=$JAVA_HOME/bin/javac
  
  
  

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

2003-09-18 Thread kinman
kinman  2003/09/18 16:12:39

  Modified:jasper2/src/share/org/apache/jasper/compiler Generator.java
  Log:
  - When adjusting Java lines for tag handler codes that are generated in a body,
make sure to include the CustomTag node itself.  This avoid strange Smap
mappings in some cases.
  
  - Fix 22058: _jspx_push_body_count is not defined in a fragment, causing
compilation errors when it is needed.  A _jspx_push_body_count is now
defined in the Fragment_Helper class; its constructor and invokation
adjusted accordingly.
  
  Revision  ChangesPath
  1.209 +35 -16
jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/compiler/Generator.java
  
  Index: Generator.java
  ===
  RCS file: 
/home/cvs/jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/compiler/Generator.java,v
  retrieving revision 1.208
  retrieving revision 1.209
  diff -u -r1.208 -r1.209
  --- Generator.java16 Sep 2003 17:46:43 -  1.208
  +++ Generator.java18 Sep 2003 23:12:39 -  1.209
  @@ -1636,7 +1636,7 @@
   // Set up new buffer for the method
   outSave = out;
   GenBuffer genBuffer =
  -new GenBuffer(n.implementsSimpleTag() ? null : n.getBody());
  +new GenBuffer(n.implementsSimpleTag() ? null : n);
   methodsBuffered.add(genBuffer);
   out = genBuffer.getOut();
   
  @@ -2957,11 +2957,17 @@
   isSimpleTagParent = true;
   boolean tmpIsFragment = isFragment;
   isFragment = true;
  +String pushBodyCountVarSave = pushBodyCountVar;
  +if (pushBodyCountVar != null) {
  +// Use a fixed name for push body count, to simplify code gen
  +pushBodyCountVar = _jspx_push_body_count;
  +}
   visitBody(n);
   out = outSave;
   parent = tmpParent;
   isSimpleTagParent = isSimpleTagParentSave;
   isFragment = tmpIsFragment;
  +pushBodyCountVar = pushBodyCountVarSave;
   fragmentHelperClass.closeFragment(fragment, methodNesting);
   // XXX - Need to change pageContext to jspContext if
   // we're not in a place where pageContext is defined (e.g.
  @@ -2973,6 +2979,8 @@
   + fragment.getId()
   + , pageContext, 
   + tagHandlerVar
  ++ , 
  ++ pushBodyCountVar
   + ));
   }
   
  @@ -3691,14 +3699,17 @@
*/
   private static class GenBuffer {
   
  -private Node.Nodes body;
  +private Node node;
   private java.io.CharArrayWriter charWriter;
   protected ServletWriter out;
   
  -GenBuffer(Node.Nodes body) {
  -this.body = body;
  -if (body != null) {
  -body.setGeneratedInBuffer(true);
  +GenBuffer(Node n) {
  +node = n;
  +if (n != null) {
  +Node.Nodes body = n.getBody();
  +if (body != null) {
  +body.setGeneratedInBuffer(true);
  +}
   }
   charWriter = new java.io.CharArrayWriter();
   out = new ServletWriter(new java.io.PrintWriter(charWriter));
  @@ -3720,9 +3731,10 @@
*/
   public void adjustJavaLines(final int offset) {
   
  -if (body != null) {
  +if (node != null) {
   try {
  -body.visit(new Node.Visitor() {
  +node.accept(new Node.Visitor() {
  +
   public void doVisit(Node n) {
   if (n.getBeginJavaLine()  0) {
   n.setBeginJavaLine(
  @@ -3735,7 +3747,11 @@
   throws JasperException {
   doVisit(n);
   Node.Nodes body = n.getBody();
  -if (body != null  !body.isGeneratedInBuffer()) {
  +if (body != null 
  +((node == n) || !body.isGeneratedInBuffer())) {
  +// We want to adjust the Java lines only for
  +// top level Custom tags, unless its body is
  +// not generated in a buffer.
   body.visit(this);
   }
   }
  @@ -3755,9 +3771,9 @@
   private GenBuffer genBuffer;
   private int id;
   
  -public Fragment(int id, Node.Nodes body) {
  +public Fragment(int id, Node node) {
   this.id = id;
  -genBuffer = new GenBuffer(body

cvs commit: jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/compiler Generator.java Node.java SmapStratum.java SmapUtil.java

2003-09-16 Thread kinman
kinman  2003/09/16 10:46:44

  Modified:jasper2/src/share/org/apache/jasper/compiler Generator.java
Node.java SmapStratum.java SmapUtil.java
  Log:
  - For template texts that generate multiple Java lines, addidtional mapping
informantion are kept in the TemplateText node, to aide SMAP generation.
  
  Revision  ChangesPath
  1.208 +23 -14
jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/compiler/Generator.java
  
  Index: Generator.java
  ===
  RCS file: 
/home/cvs/jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/compiler/Generator.java,v
  retrieving revision 1.207
  retrieving revision 1.208
  diff -u -r1.207 -r1.208
  --- Generator.java15 Sep 2003 13:43:54 -  1.207
  +++ Generator.java16 Sep 2003 17:46:43 -  1.208
  @@ -1867,21 +1867,25 @@
   return;
   }
   
  -if (ctxt.getOptions().genStringAsCharArray()) {
  -if (textSize = 3) {
  -   // Spcial case small text strings
  -   n.setBeginJavaLine(out.getJavaLine());
  -   out.printil(out.write( + quote(text.charAt(0)) + ););
  -   if (textSize  1) {
  -   out.printil(out.write( + quote(text.charAt(1)) + ););
  +if (textSize = 3) {
  +   // Special case small text strings
  +   n.setBeginJavaLine(out.getJavaLine());
  +   int lineInc = 0;
  +   for (int i = 0; i  textSize; i++) {
  +   char ch = text.charAt(i);
  +   out.printil(out.write( + quote(ch) + ););
  +   if (i  0) {
  +   n.addSmap(lineInc);
  }
  -   if (textSize  2) {
  -   out.printil(out.write( + quote(text.charAt(2)) + ););
  +   if (ch == '\n') {
  +   lineInc++;
  }
  -   n.setEndJavaLine(out.getJavaLine());
  -   return;
  }
  +   n.setEndJavaLine(out.getJavaLine());
  +   return;
  +   }
   
  +if (ctxt.getOptions().genStringAsCharArray()) {
  // Generate Strings as char arrays, for performance
   ServletWriter caOut;
   if (charArrayBuffer == null) {
  @@ -1915,6 +1919,7 @@
   StringBuffer sb = new StringBuffer(out.write(\);
   int initLength = sb.length();
   int count = JspUtil.CHUNKSIZE;
  +int srcLine = 0; // relative to starting srouce line
   for (int i = 0; i  text.length(); i++) {
   char ch = text.charAt(i);
   --count;
  @@ -1930,6 +1935,7 @@
   break;
   case '\n' :
   sb.append('\\').append('n');
  +srcLine++;
   
   if (breakAtLF || count  0) {
   // Generate an out.write() when see a '\n' in template
  @@ -1940,6 +1946,9 @@
   }
   sb.setLength(initLength);
   count = JspUtil.CHUNKSIZE;
  +
  +// add a Smap for this line
  +n.addSmap(srcLine);
   }
   break;
   case '\t' : // Not sure we need this
  
  
  
  1.77  +24 -4 
jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/compiler/Node.java
  
  Index: Node.java
  ===
  RCS file: 
/home/cvs/jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/compiler/Node.java,v
  retrieving revision 1.76
  retrieving revision 1.77
  diff -u -r1.76 -r1.77
  --- Node.java 2 Sep 2003 21:39:59 -   1.76
  +++ Node.java 16 Sep 2003 17:46:43 -  1.77
  @@ -63,6 +63,7 @@
   import java.util.Iterator;
   import java.util.List;
   import java.util.Vector;
  +import java.util.ArrayList;
   
   import javax.servlet.jsp.tagext.BodyTag;
   import javax.servlet.jsp.tagext.DynamicAttributes;
  @@ -1921,6 +1922,8 @@
*/
   public static class TemplateText extends Node {
   
  +private ArrayList extraSmap = null;
  +
public TemplateText(String text, Mark start, Node parent) {
super(null, null, text, start, parent);
}
  @@ -1957,13 +1960,30 @@
public boolean isAllSpace() {
boolean isAllSpace = true;
for (int i=0; itext.length(); i++) {
  - if (!Character.isSpace(text.charAt(i))) {
  + if (!Character.isWhitespace(text.charAt(i))) {
isAllSpace = false;
break;
}
}
return isAllSpace

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

2003-09-10 Thread kinman
kinman  2003/09/10 16:11:56

  Modified:jasper2/src/share/org/apache/jasper/compiler Generator.java
  Log:
  - Use out.print(expr) instead of out.write(String.valueOf(expr)) for outputting
expressions in template texts.
  
  Revision  ChangesPath
  1.206 +4 -5  
jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/compiler/Generator.java
  
  Index: Generator.java
  ===
  RCS file: 
/home/cvs/jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/compiler/Generator.java,v
  retrieving revision 1.205
  retrieving revision 1.206
  diff -u -r1.205 -r1.206
  --- Generator.java9 Sep 2003 21:46:22 -   1.205
  +++ Generator.java10 Sep 2003 23:11:56 -  1.206
  @@ -869,8 +869,7 @@
   
   public void visit(Node.Expression n) throws JasperException {
   n.setBeginJavaLine(out.getJavaLine());
  -out.printil(
  -out.write(String.valueOf( + new String(n.getText()) + )););
  +out.printil(out.print( + n.getText() + ););
   n.setEndJavaLine(out.getJavaLine());
   }
   
  
  
  

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



cvs commit: jakarta-tomcat-catalina/catalina/src/conf web.xml

2003-09-09 Thread kinman
kinman  2003/09/09 14:47:11

  Modified:catalina/src/conf web.xml
  Log:
  - Add an compilation option to generate writing char arrays instead of Strings
for template texts.
  
  Revision  ChangesPath
  1.25  +4 -0  jakarta-tomcat-catalina/catalina/src/conf/web.xml
  
  Index: web.xml
  ===
  RCS file: /home/cvs/jakarta-tomcat-catalina/catalina/src/conf/web.xml,v
  retrieving revision 1.24
  retrieving revision 1.25
  diff -u -r1.24 -r1.25
  --- web.xml   19 Aug 2003 00:17:03 -  1.24
  +++ web.xml   9 Sep 2003 21:47:11 -   1.25
  @@ -157,6 +157,10 @@
 !--   dumped to a file? [false]  --
 !--   False if suppressSmap is true  --
 !--  --
  +  !--   genStrAsCharArray   Should text strings be generated as char   --
  +  !--   arrays, to improve performance in some cases?  --
  +  !--   [false]--
  +  !--  --
 !--   scratchdir  What scratch directory should we use when  --
 !--   compiling JSP pages?  [default work directory  --
 !--   for the current web application]   --
  
  
  

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

2003-09-04 Thread kinman
kinman  2003/09/04 15:30:06

  Modified:jasper2/src/share/org/apache/jasper/compiler Generator.java
  Log:
  - Fix a careless mistake.
  
  Revision  ChangesPath
  1.204 +4 -4  
jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/compiler/Generator.java
  
  Index: Generator.java
  ===
  RCS file: 
/home/cvs/jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/compiler/Generator.java,v
  retrieving revision 1.203
  retrieving revision 1.204
  diff -u -r1.203 -r1.204
  --- Generator.java3 Sep 2003 21:20:28 -   1.203
  +++ Generator.java4 Sep 2003 22:30:06 -   1.204
  @@ -3466,7 +3466,7 @@
*/
   public void generateSetDynamicAttribute() {
   out.printil(
  -public void setDynamicAttribute(String uri, String localName, Object 
value) throws jsp.JspException {);
  +public void setDynamicAttribute(String uri, String localName, Object 
value) throws JspException {);
   out.pushIndent();
   /* 
* According to the spec, only dynamic attributes with no uri are to
  
  
  

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

2003-09-03 Thread kinman
kinman  2003/09/03 14:20:29

  Modified:jasper2/src/share/org/apache/jasper/compiler Generator.java
  Log:
  - Use just the class name if package is imported.
  - In tag files, declare request as HttpServletRequest and response
HttpServletResponse, as is the case in servlets.
  
  Revision  ChangesPath
  1.203 +25 -39
jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/compiler/Generator.java
  
  Index: Generator.java
  ===
  RCS file: 
/home/cvs/jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/compiler/Generator.java,v
  retrieving revision 1.202
  retrieving revision 1.203
  diff -u -r1.202 -r1.203
  --- Generator.java2 Sep 2003 05:50:47 -   1.202
  +++ Generator.java3 Sep 2003 21:20:28 -   1.203
  @@ -1002,7 +1002,7 @@
   printParams(n, pageParam, page.isLiteral());
   out.println(););
   if (isTagFile || isFragment) {
  -out.printil(throw new javax.servlet.jsp.SkipPageException(););
  +out.printil(throw new SkipPageException(););
   } else {
   out.printil((methodNesting  0) ? return true; : return;);
   }
  @@ -1119,10 +1119,6 @@
   + pageContext, 
   + value.getEL().getMapName()
   + ););
  -/*
  -+ (javax.servlet.jsp.el.VariableResolver) 
pageContext, 
  -+ (javax.servlet.jsp.el.FunctionMapper) this 
););
  -*/
   } else if (value.isNamedAttribute()) {
   // If the value for setProperty was specified via
   // jsp:attribute, first generate code to evaluate
  @@ -2186,7 +2182,7 @@
   .doEndTag() == javax.servlet.jsp.tagext.Tag.SKIP_PAGE));
   out.pushIndent();
   if (isTagFile || isFragment) {
  -out.printil(throw new javax.servlet.jsp.SkipPageException(););
  +out.printil(throw new SkipPageException(););
   } else {
   out.printil((methodNesting  0) ? return true; : return;);
   }
  @@ -3046,7 +3042,7 @@
   out.printil(} catch (Throwable t) {);
   out.pushIndent();
   out.printil(
  -if (!(t instanceof javax.servlet.jsp.SkipPageException)){);
  +if (!(t instanceof SkipPageException)){);
   out.pushIndent();
   out.printil(out = _jspx_out;);
   out.printil(if (out != null  out.getBufferSize() != 0));
  @@ -3227,7 +3223,7 @@
   
   // Now the doTag() method
   out.printil(
  -public void doTag() throws javax.servlet.jsp.JspException, 
java.io.IOException {);
  +public void doTag() throws JspException, java.io.IOException {);
   
   if (ctxt.isPrototypeMode()) {
   out.printil(});
  @@ -3240,27 +3236,17 @@
   out.printil(PageContext pageContext = (PageContext)jspContext;);
   
   // Declare implicit objects.  
  -// XXX - Note that the current JSP 2.0 PFD 
  -// spec is unclear about whether these are required
  -// XXX - Optimization: Check scriptlets and expressions for the
  -// use of any of these.  They're not likely to be used.  If they're
  -// not used, get rid of them.
  -out.printil(
  -javax.servlet.ServletRequest request = 
  -+ pageContext.getRequest(););
  -out.printil(
  -javax.servlet.ServletResponse response = 
  -+ pageContext.getResponse(););
   out.printil(
  -javax.servlet.http.HttpSession session = 
  -+ pageContext.getSession(););
  +HttpServletRequest request = 
  ++ (HttpServletRequest) pageContext.getRequest(););
   out.printil(
  -javax.servlet.ServletContext application = 
  -+ pageContext.getServletContext(););
  +HttpServletResponse response = 
  ++ (HttpServletResponse) pageContext.getResponse(););
  +out.printil(HttpSession session = pageContext.getSession(););
   out.printil(
  -javax.servlet.ServletConfig config = 
  -+ pageContext.getServletConfig(););
  -out.printil(javax.servlet.jsp.JspWriter out = jspContext.getOut(););
  +ServletContext application = pageContext.getServletContext(););
  +out.printil(ServletConfig config = pageContext.getServletConfig(););
  +out.printil(JspWriter out = jspContext.getOut(););
   if (isPoolingEnabled  !tagHandlerPoolNames.isEmpty()) {
   out.printil(_jspInit(config););
   }
  @@ -3284,15 +3270,15 @@
   // helper method is declared to throw Throwable.
   out.printil(} catch

cvs commit: jakarta-servletapi-5/jsr152/src/share/javax/servlet/jsp/tagext IterationTag.java

2003-09-03 Thread kinman
kinman  2003/09/03 16:18:33

  Modified:jsr152/src/share/javax/servlet/jsp/tagext IterationTag.java
  Log:
  - Patch by Mark Roth:
  
Clarified that doAfterBody() is not called if there is no body.
  
  Revision  ChangesPath
  1.7   +10 -8 
jakarta-servletapi-5/jsr152/src/share/javax/servlet/jsp/tagext/IterationTag.java
  
  Index: IterationTag.java
  ===
  RCS file: 
/home/cvs/jakarta-servletapi-5/jsr152/src/share/javax/servlet/jsp/tagext/IterationTag.java,v
  retrieving revision 1.6
  retrieving revision 1.7
  diff -u -r1.6 -r1.7
  --- IterationTag.java 31 Mar 2003 17:52:26 -  1.6
  +++ IterationTag.java 3 Sep 2003 23:18:32 -   1.7
  @@ -91,21 +91,23 @@
*
* pBEmpty and Non-Empty Action/B
* p If the TagLibraryDescriptor file indicates that the action must
  - * always have an empty action, by an lt;body-contentgt; entry of empty,
  - * then the doStartTag() method must return SKIP_BODY.
  + * always have an empty element body, by a lt;body-contentgt; entry of 
  + * empty, then the doStartTag() method must return SKIP_BODY.
*
  - * Otherwise, the doStartTag() method may return SKIP_BODY or
  - * EVAL_BODY_INCLUDE.
  + * pNote that which methods are invoked after the doStartTag() depends on
  + * both the return value and on if the custom action element is empty
  + * or not in the JSP page, not on how it's declared in the TLD.
*
* p
* If SKIP_BODY is returned the body is not evaluated, and then doEndTag()
* is invoked.
*
* p
  - * If EVAL_BODY_INCLUDE is returned, the body is evaluated and
  - * passed through to the current out, then doAfterBody() is invoked
  - * and, after zero or more iterations, doEndTag() is invoked.
  -*/
  + * If EVAL_BODY_INCLUDE is returned, and the custom action element is not
  + * empty, the body is evaluated and passed through to the current out, 
  + * then doAfterBody() is invoked and, after zero or more iterations, 
  + * doEndTag() is invoked.
  + */
   
   public interface IterationTag extends Tag {
   
  
  
  

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

2003-08-27 Thread kinman
kinman  2003/08/26 17:47:19

  Modified:jasper2/src/share/org/apache/jasper JspC.java
   jasper2/src/share/org/apache/jasper/compiler JspConfig.java
  Log:
  - When precompiling with JSPC, files that mathch the url-pattern specified
in jsp-config should be included for compilation.
  
  Revision  ChangesPath
  1.58  +12 -10
jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/JspC.java
  
  Index: JspC.java
  ===
  RCS file: 
/home/cvs/jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/JspC.java,v
  retrieving revision 1.57
  retrieving revision 1.58
  diff -u -r1.57 -r1.58
  --- JspC.java 12 Aug 2003 19:40:17 -  1.57
  +++ JspC.java 27 Aug 2003 00:47:19 -  1.58
  @@ -776,7 +776,7 @@
* Locate all jsp files in the webapp. Used if no explicit
* jsps are specified.
*/
  -public void scanFiles( File base ) {
  +public void scanFiles( File base ) throws JasperException {
   Stack dirs = new Stack();
   dirs.push(base);
   if (extensions == null) {
  @@ -798,12 +798,14 @@
   dirs.push(f2.getPath());
   //System.out.println(++ + f2.getPath());
   } else {
  +String path = f2.getPath();
  +String uri = path.substring(uriRoot.length());
   ext = files[i].substring(files[i].lastIndexOf('.')
 + 1);
  -if (extensions.contains(ext)) {
  +if (extensions.contains(ext) ||
  +jspConfig.isJspPage(uri)) {
   //System.out.println(s + ? + files[i]);
  -pages.addElement(s + File.separatorChar
  -  + files[i]);
  +pages.addElement(path);
   } else {
//System.out.println(not done: + ext);
   }
  @@ -831,6 +833,9 @@
   locateUriRoot( firstJspF );
}
   
  + if( context==null )
  + initServletContext();
  +
// No explicit page, we'll process all .jsp in the webapp
if (pages.size() == 0) {
scanFiles( new File( uriRoot ));
  @@ -845,9 +850,6 @@
throw new JasperException(
   Localizer.getMessage(jsp.error.jspc.uriroot_not_dir));
}
  -
  - if( context==null )
  - initServletContext();
   
initWebXml();
   
  
  
  
  1.12  +61 -9 
jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/compiler/JspConfig.java
  
  Index: JspConfig.java
  ===
  RCS file: 
/home/cvs/jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/compiler/JspConfig.java,v
  retrieving revision 1.11
  retrieving revision 1.12
  diff -u -r1.11 -r1.12
  --- JspConfig.java31 Jul 2003 18:51:16 -  1.11
  +++ JspConfig.java27 Aug 2003 00:47:19 -  1.12
  @@ -208,12 +208,7 @@
}
   }
   
  -/**
  - * Find a property that best matches the supplied resource.
  - * @param uri the resource supplied.
  - * @return a JspProperty if a match is found, null otherwise
  - */
  -public JspProperty findJspProperty(String uri) throws JasperException {
  +private void init() throws JasperException {
   
if (!initialized) {
processWebDotXml(ctxt);
  @@ -223,6 +218,16 @@
 null, null, null);
initialized = true;
}
  +}
  +
  +/**
  + * Find a property that best matches the supplied resource.
  + * @param uri the resource supplied.
  + * @return a JspProperty indicating the best match, or some default.
  + */
  +public JspProperty findJspProperty(String uri) throws JasperException {
  +
  + init();
   
// JSP Configuration settings do not apply to tag files 
if (jspProperties == null || uri.endsWith(.tag)
  @@ -362,6 +367,53 @@
   
return new JspProperty(isXml, isELIgnored, isScriptingInvalid,
   pageEncoding, includePreludes, includeCodas);
  +}
  +
  +/**
  + * To find out if an uri matches an url pattern in jsp config.  If so,
  + * then the uri is a JSP page.  This is used primarily for jspc.
  + */
  +public boolean isJspPage(String uri) throws JasperException {
  +
  +init();
  +if (jspProperties == null) {
  +return false;
  +}
  +
  +String uriPath = null;
  +int index = uri.lastIndexOf('/');
  +if (index =0 ) {
  +uriPath = uri.substring(0, index+1

cvs commit: jakarta-servletapi-5/jsr152/src/share/javax/servlet/jsp/tagext TagInfo.java TagLibraryValidator.java

2003-08-25 Thread kinman
kinman  2003/08/25 13:56:44

  Modified:jsr152/src/share/javax/servlet/jsp/tagext TagInfo.java
TagLibraryValidator.java
  Log:
  - Patch by Mark Roth.
  
  jsr152/src/share/javax/servlet/jsp/tagext/TagInfo.java
   - Fixed incorrect clarification of getVariableInfo().  The original
 semantics requiring special treatment of the id attribute
 were supposed to have been removed in JSP 1.2.  We brought them
 back to life in JSP 2.0, but the right thing to do was to remove
 them altogether, as no other containers implemented them anyway.
  
  jsr152/src/share/javax/servlet/jsp/tagext/TagLibraryValidator.java
   - Clarified that the URI passed to validate() is the same as
 the URI in the XML View, not the uri passed to the taglib
 directive (which doesn't always exist or produce consistent
 results)
  
  Revision  ChangesPath
  1.8   +1 -13 
jakarta-servletapi-5/jsr152/src/share/javax/servlet/jsp/tagext/TagInfo.java
  
  Index: TagInfo.java
  ===
  RCS file: 
/home/cvs/jakarta-servletapi-5/jsr152/src/share/javax/servlet/jsp/tagext/TagInfo.java,v
  retrieving revision 1.7
  retrieving revision 1.8
  diff -u -r1.7 -r1.8
  --- TagInfo.java  8 Aug 2003 22:27:40 -   1.7
  +++ TagInfo.java  25 Aug 2003 20:56:44 -  1.8
  @@ -268,25 +268,13 @@
* @param data TagData describing this action.
* @return if a TagExtraInfo object is associated with this TagInfo, the
* result of getTagExtraInfo().getVariableInfo( data ), otherwise
  - * null if the tag has no id attribute or new VariableInfo[] {
  - * new VariableInfo( data.getId(), java.lang.Object, true,
  - * VariableInfo.NESTED ) } if an id attribute is present.
  + * null.
*/
  public VariableInfo[] getVariableInfo(TagData data) {
  VariableInfo[] result = null;
  TagExtraInfo tei = getTagExtraInfo();
  if (tei != null) {
   result = tei.getVariableInfo( data );
  -   }
  -   else {
  -String idValue = data.getId();
  -if( idValue != null ) {
  -result = 
  -new VariableInfo[] {
  -new VariableInfo( idValue, java.lang.Object,
  -true, VariableInfo.NESTED )
  -};
  -}
  }
  return result;
  }
  
  
  
  1.7   +1 -1  
jakarta-servletapi-5/jsr152/src/share/javax/servlet/jsp/tagext/TagLibraryValidator.java
  
  Index: TagLibraryValidator.java
  ===
  RCS file: 
/home/cvs/jakarta-servletapi-5/jsr152/src/share/javax/servlet/jsp/tagext/TagLibraryValidator.java,v
  retrieving revision 1.6
  retrieving revision 1.7
  diff -u -r1.6 -r1.7
  --- TagLibraryValidator.java  14 Apr 2003 17:36:39 -  1.6
  +++ TagLibraryValidator.java  25 Aug 2003 20:56:44 -  1.7
  @@ -76,7 +76,7 @@
*
* once initialized, the validate(String, String, PageData) method will
* be invoked, where the first two arguments are the prefix
  - * and uri arguments used in the taglib directive.  The prefix is intended
  + * and uri for this tag library in the XML View.  The prefix is intended
* to make it easier to produce an error message.  However, it is not
* always accurate.  In the case where a single URI is mapped to more 
* than one prefix in the XML view, the prefix of the first URI is provided.
  
  
  

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



cvs commit: jakarta-servletapi-5/jsr152/src/share/javax/servlet/jsp/tagext TagLibraryValidator.java

2003-08-25 Thread kinman
kinman  2003/08/25 14:16:26

  Modified:jsr152/src/share/javax/servlet/jsp/tagext
TagLibraryValidator.java
  Log:
  - Change javadocs for param too.
  
  Revision  ChangesPath
  1.8   +1 -1  
jakarta-servletapi-5/jsr152/src/share/javax/servlet/jsp/tagext/TagLibraryValidator.java
  
  Index: TagLibraryValidator.java
  ===
  RCS file: 
/home/cvs/jakarta-servletapi-5/jsr152/src/share/javax/servlet/jsp/tagext/TagLibraryValidator.java,v
  retrieving revision 1.7
  retrieving revision 1.8
  diff -u -r1.7 -r1.8
  --- TagLibraryValidator.java  25 Aug 2003 20:56:44 -  1.7
  +++ TagLibraryValidator.java  25 Aug 2003 21:16:26 -  1.8
  @@ -158,7 +158,7 @@
* @param prefix the first prefix with which the tag library is 
* associated, in the XML view.  Note that some tags may use 
* a different prefix if the namespace is redefined.
  - * @param uri the value of the uri argument in the directive
  + * @param uri the tag library's unique identifier
* @param page the JspData page object
* @return A null object, or zero length array if no errors, an array
* of ValidationMessages otherwise.
  
  
  

-
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 JspDocumentParser.java ErrorDispatcher.java

2003-08-21 Thread kinman
kinman  2003/08/21 16:10:50

  Modified:jasper2/src/share/org/apache/jasper/compiler
JspDocumentParser.java ErrorDispatcher.java
  Log:
  - Looks like when there is a SAX paser error, a null file name is always
reported.  This fix get the file name from path instead of from the
expection.
  
  Revision  ChangesPath
  1.66  +7 -4  
jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/compiler/JspDocumentParser.java
  
  Index: JspDocumentParser.java
  ===
  RCS file: 
/home/cvs/jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/compiler/JspDocumentParser.java,v
  retrieving revision 1.65
  retrieving revision 1.66
  diff -u -r1.65 -r1.66
  --- JspDocumentParser.java15 Aug 2003 00:06:09 -  1.65
  +++ JspDocumentParser.java21 Aug 2003 23:10:49 -  1.66
  @@ -193,7 +193,10 @@
} catch (IOException ioe) {
jspDocParser.err.jspError(jsp.error.data.file.read, path, ioe);
} catch (Exception e) {
  - jspDocParser.err.jspError(e);
  + jspDocParser.err.jspError(
  + new Mark(path, ((SAXParseException) e).getLineNumber(),
  +  ((SAXParseException) e).getColumnNumber()),
  + e.getMessage());
}
   
return pageNodes;
  
  
  
  1.14  +3 -8  
jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/compiler/ErrorDispatcher.java
  
  Index: ErrorDispatcher.java
  ===
  RCS file: 
/home/cvs/jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/compiler/ErrorDispatcher.java,v
  retrieving revision 1.13
  retrieving revision 1.14
  diff -u -r1.13 -r1.14
  --- ErrorDispatcher.java  14 Aug 2003 21:16:52 -  1.13
  +++ ErrorDispatcher.java  21 Aug 2003 23:10:49 -  1.14
  @@ -386,11 +386,6 @@
line = where.getLineNumber();
column = where.getColumnNumber();
hasLocation = true;
  - } else if (e instanceof SAXParseException) {
  - file = ((SAXParseException) e).getSystemId();
  - line = ((SAXParseException) e).getLineNumber();
  - column = ((SAXParseException) e).getColumnNumber();
  - hasLocation = true;
}
   
// Get nested exception
  
  
  

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



  1   2   3   4   5   >