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

2005-07-21 Thread Jan Luehe
Bill,

[EMAIL PROTECTED] wrote:
 billbarker2005/07/20 20:59:10
 
   Modified:jasper2/src/share/org/apache/jasper/compiler Generator.java
   Log:
   Make certain that release is called for custom tags when tag-pooling is 
 disabled.
   
   Fix for Bug #35696
   
   Revision  ChangesPath
   1.241 +9 -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.240
   retrieving revision 1.241
   diff -u -r1.240 -r1.241
   --- Generator.java  5 Apr 2005 23:14:43 -   1.240
   +++ Generator.java  21 Jul 2005 03:59:10 -  1.241
   @@ -2278,15 +2278,19 @@
out.printin(if ();
out.print(tagHandlerVar);
out.println(
   -.doEndTag() == javax.servlet.jsp.tagext.Tag.SKIP_PAGE));
   +.doEndTag() == javax.servlet.jsp.tagext.Tag.SKIP_PAGE) 
 {);
out.pushIndent();
   +if(!n.implementsTryCatchFinally()) {
   +out.printin(tagHandlerVar);
   +out.println(.release(););
   +}

I believe the above 4 added lines need to be replaced with this:

+if (!n.implementsTryCatchFinally()) {
+
+if (isPoolingEnabled) {
+out.printin(n.getTagHandlerPoolName());
+out.print(.reuse();
+out.print(tagHandlerVar);
+out.println(););
+} else {
+out.printin(tagHandlerVar);
+out.println(.release(););
+}
+}


Jan


if (isTagFile || isFragment) {
out.printil(throw new SkipPageException(););
} else {
out.printil((methodNesting  0) ? return true; : 
 return;);
}
out.popIndent();
   -
   +out.printil(});
// Synchronize AT_BEGIN scripting variables
syncScriptingVars(n, VariableInfo.AT_BEGIN);

   @@ -2317,6 +2321,9 @@
out.print(.reuse();
out.print(tagHandlerVar);
out.println(););
   +} else {
   +out.printin(tagHandlerVar);
   +out.println(.release(););
}

if (n.implementsTryCatchFinally()) {
   
   
   
 
 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 


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



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

2005-07-21 Thread Bill Barker


- Original Message - 
From: Jan Luehe [EMAIL PROTECTED]

To: Tomcat Developers List tomcat-dev@jakarta.apache.org
Sent: Thursday, July 21, 2005 6:24 PM
Subject: Re: cvs commit: 
jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/compiler 
Generator.java




Bill,

[EMAIL PROTECTED] wrote:

billbarker2005/07/20 20:59:10

  Modified:jasper2/src/share/org/apache/jasper/compiler 
Generator.java

  Log:
  Make certain that release is called for custom tags when tag-pooling is 
disabled.


  Fix for Bug #35696

  Revision  ChangesPath
  1.241 +9 -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.240
  retrieving revision 1.241
  diff -u -r1.240 -r1.241
  --- Generator.java 5 Apr 2005 23:14:43 - 1.240
  +++ Generator.java 21 Jul 2005 03:59:10 - 1.241
  @@ -2278,15 +2278,19 @@
   out.printin(if ();
   out.print(tagHandlerVar);
   out.println(
  -.doEndTag() == 
javax.servlet.jsp.tagext.Tag.SKIP_PAGE));
  +.doEndTag() == 
javax.servlet.jsp.tagext.Tag.SKIP_PAGE) {);

   out.pushIndent();
  +if(!n.implementsTryCatchFinally()) {
  +out.printin(tagHandlerVar);
  +out.println(.release(););
  +}


I believe the above 4 added lines need to be replaced with this:



Yeah, but but the previous code was simply throwing the tag away on 
SKIP_PAGE (at least for non-TCF tags), and I didn't want to dig to find out 
if it was doing it for a reason (especially since SKIP_PAGE happens almost 
never :).  I figured that if we're going to throw it away, we should at 
least call release on it first :).



   +if (!n.implementsTryCatchFinally()) {
   +
   +if (isPoolingEnabled) {
   +out.printin(n.getTagHandlerPoolName());
   +out.print(.reuse();
   +out.print(tagHandlerVar);
   +out.println(););
   +} else {
   +out.printin(tagHandlerVar);
   +out.println(.release(););
   +}
   +}


Jan



   if (isTagFile || isFragment) {
   out.printil(throw new SkipPageException(););
   } else {
   out.printil((methodNesting  0) ? return true; : 
return;);

   }
   out.popIndent();
  -
  +out.printil(});
   // Synchronize AT_BEGIN scripting variables
   syncScriptingVars(n, VariableInfo.AT_BEGIN);

  @@ -2317,6 +2321,9 @@
   out.print(.reuse();
   out.print(tagHandlerVar);
   out.println(););
  +} else {
  +out.printin(tagHandlerVar);
  +out.println(.release(););
   }

   if (n.implementsTryCatchFinally()) {




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




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







This message is intended only for the use of the person(s) listed above as the 
intended recipient(s), and may contain information that is PRIVILEGED and 
CONFIDENTIAL.  If you are not an intended recipient, you may not read, copy, or 
distribute this message or any attachment. If you received this communication 
in error, please notify us immediately by e-mail and then delete all copies of 
this message and any attachments.

In addition you should be aware that ordinary (unencrypted) e-mail sent through 
the Internet is not secure. Do not send confidential or sensitive information, 
such as social security numbers, account numbers, personal identification 
numbers and passwords, to us via ordinary (unencrypted) e-mail.


-
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-07-21 Thread billbarker
billbarker2005/07/21 21:16:25

  Modified:jasper2/src/share/org/apache/jasper/compiler Generator.java
  Log:
  Return a custom tag to the pool when doEndTag returns SKIP_PAGE
  
  Submitted by: Jan
  
  Revision  ChangesPath
  1.242 +9 -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.241
  retrieving revision 1.242
  diff -u -r1.241 -r1.242
  --- Generator.java21 Jul 2005 03:59:10 -  1.241
  +++ Generator.java22 Jul 2005 04:16:24 -  1.242
  @@ -2281,8 +2281,15 @@
   .doEndTag() == javax.servlet.jsp.tagext.Tag.SKIP_PAGE) {);
   out.pushIndent();
   if(!n.implementsTryCatchFinally()) {
  -out.printin(tagHandlerVar);
  -out.println(.release(););
  +if(isPoolingEnabled) {
  +out.printin(n.getTagHandlerPoolName());
  +out.print(.reuse();
  +out.print(tagHandlerVar);
  +out.println(););
  +} else {
  +out.printin(tagHandlerVar);
  +out.println(.release(););
  +}
   }
   if (isTagFile || isFragment) {
   out.printil(throw new SkipPageException(););
  
  
  

-
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-07-20 Thread billbarker
billbarker2005/07/20 20:59:10

  Modified:jasper2/src/share/org/apache/jasper/compiler Generator.java
  Log:
  Make certain that release is called for custom tags when tag-pooling is 
disabled.
  
  Fix for Bug #35696
  
  Revision  ChangesPath
  1.241 +9 -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.240
  retrieving revision 1.241
  diff -u -r1.240 -r1.241
  --- Generator.java5 Apr 2005 23:14:43 -   1.240
  +++ Generator.java21 Jul 2005 03:59:10 -  1.241
  @@ -2278,15 +2278,19 @@
   out.printin(if ();
   out.print(tagHandlerVar);
   out.println(
  -.doEndTag() == javax.servlet.jsp.tagext.Tag.SKIP_PAGE));
  +.doEndTag() == javax.servlet.jsp.tagext.Tag.SKIP_PAGE) {);
   out.pushIndent();
  +if(!n.implementsTryCatchFinally()) {
  +out.printin(tagHandlerVar);
  +out.println(.release(););
  +}
   if (isTagFile || isFragment) {
   out.printil(throw new SkipPageException(););
   } else {
   out.printil((methodNesting  0) ? return true; : 
return;);
   }
   out.popIndent();
  -
  +out.printil(});
   // Synchronize AT_BEGIN scripting variables
   syncScriptingVars(n, VariableInfo.AT_BEGIN);
   
  @@ -2317,6 +2321,9 @@
   out.print(.reuse();
   out.print(tagHandlerVar);
   out.println(););
  +} else {
  +out.printin(tagHandlerVar);
  +out.println(.release(););
   }
   
   if (n.implementsTryCatchFinally()) {
  
  
  

-
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

2005-03-02 Thread markt
markt   2005/03/02 12:56:03

  Modified:jasper2/src/share/org/apache/jasper/compiler Tag:
tomcat_4_branch Generator.java JspUtil.java
  Log:
  Port fix for 22867 tag handlers can't be inner/nested classes from TC5
   - TC4 port provided by Steven Parkes in bug 24586
  
  Revision  ChangesPath
  No   revision
  No   revision
  1.35.2.28 +14 -10
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.27
  retrieving revision 1.35.2.28
  diff -u -r1.35.2.27 -r1.35.2.28
  --- Generator.java22 Feb 2005 22:00:54 -  1.35.2.27
  +++ Generator.java2 Mar 2005 20:56:02 -   1.35.2.28
  @@ -648,7 +648,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();
  @@ -1293,21 +1293,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 (ctxt.getOptions().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((););
   }
   
  @@ -1750,11 +1752,12 @@
   throws JasperException {
   
   if (propEditorClass != null) {
  -return ( + c.getName()
  +String className = JspUtil.getCanonicalName(c);
  +return ( + className
   + 
)JspRuntimeLibrary.getValueFromBeanInfoPropertyEditor(
  -+ c.getName() + .class, \ + attrName + \, 
  ++ className + .class, \ + attrName + \, 
   + quote(s) + , 
  -+ propEditorClass.getName() + .class);
  ++ JspUtil.getCanonicalName(propEditorClass) + .class);
   } else if (c == String.class) {
   return quote(s);
   } else if (c == boolean.class) {
  @@ -1808,9 +1811,10 @@
   } else if (c == Object.class) {
   return new String( + quote(s) + );
   } else {
  -return ( + c.getName()
  +String className = JspUtil.getCanonicalName(c);
  +return ( + className
   + )JspRuntimeLibrary.getValueFromPropertyEditorManager(
  -+ c.getName() + .class, \ + attrName + \, 
  ++ className + .class, \ + attrName + \, 
   + quote(s) + );
   }
   }   
  
  
  
  1.4.2.4   +29 -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.4.2.3
  retrieving revision 1.4.2.4
  diff -u -r1.4.2.3 -r1.4.2.4
  --- JspUtil.java  25 Aug 2004 20:53:31 -  1.4.2.3
  +++ JspUtil.java  2 Mar 2005 20:56:03 -   1.4.2.4
  @@ -423,6 +423,35 @@
   }
   return b;
   }
  +
  +// javac -classpath 
~mint/tomcat/common/lib/ant.jar:~mint/tomcat/common/endorsed/xml-apis.jar:~mint/tomcat/common/lib/servlet.jar
 `find . -name \*.java ` 
  +
  +
  +/**
  + * Compute the canonical name from a Class instance.  Note that a
  + * simple replacment of '$' with '.' of a binary name would not work,
  + * as '$' is a legal Java Identifier character.
  + 

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

2005-02-22 Thread markt
markt   2005/02/22 14:00:55

  Modified:jasper2/src/share/org/apache/jasper/compiler Tag:
tomcat_4_branch Generator.java
  Log:
  Fix bug 25095. Tags generated by jsp:plugin are not well-formed.
  
  Revision  ChangesPath
  No   revision
  No   revision
  1.35.2.27 +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.35.2.26
  retrieving revision 1.35.2.27
  diff -u -r1.35.2.26 -r1.35.2.27
  --- Generator.java25 Aug 2004 20:53:29 -  1.35.2.26
  +++ Generator.java22 Feb 2005 22:00:54 -  1.35.2.27
  @@ -1021,7 +1021,6 @@
   out.printil(out.println( + quote() + ););
   
   out.printil(out.println( + quote(NOEMBED) + ););
  -out.printil(out.println( + quote(/COMMENT) + ););
   
   /*
* Fallback
  @@ -1032,6 +1031,7 @@
   }
   
   out.printil(out.println( + quote(/NOEMBED/EMBED) + ););
  +out.printil(out.println( + quote(/COMMENT) + ););
   out.printil(out.println( + quote(/OBJECT) + ););
   
   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-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 Generator.java

2004-08-10 Thread luehe
luehe   2004/08/10 17:50:29

  Modified:jasper2/src/share/org/apache/jasper/compiler Tag: TOMCAT_5_0
Generator.java
  Log:
  Ported fixes for:
  - Bugzilla 30291 (Smap for a tag should not include its body)
  - Bugzilla 30289 (Incorrect Smap for multiple line java expression)
  
  Revision  ChangesPath
  No   revision
  No   revision
  1.234.2.1 +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.234
  retrieving revision 1.234.2.1
  diff -u -r1.234 -r1.234.2.1
  --- Generator.java11 Jun 2004 00:29:56 -  1.234
  +++ Generator.java11 Aug 2004 00:50:28 -  1.234.2.1
  @@ -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-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-tomcat-jasper/jasper2/src/share/org/apache/jasper/compiler Generator.java

2004-06-25 Thread luehe
luehe   2004/06/25 19:22:27

  Modified:jasper2/src/share/org/apache/jasper/compiler Tag:
tomcat_4_branch Generator.java
  Log:
  Fixed 18778: popBody not always called as expected resulting in unexpected output
  
  Revision  ChangesPath
  No   revision
  No   revision
  1.35.2.24 +11 -11
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.23
  retrieving revision 1.35.2.24
  diff -u -r1.35.2.23 -r1.35.2.24
  --- Generator.java27 Mar 2004 01:04:39 -  1.35.2.23
  +++ Generator.java26 Jun 2004 02:22:27 -  1.35.2.24
  @@ -1157,7 +1157,7 @@
   //   out.println(javax.servlet.jsp.PageContext pageContext, JspxState 
_jspxState));
out.print(javax.servlet.jsp.PageContext pageContext);
if (pushBodyCountVar != null) {
  - out.print(, int );
  + out.print(, int[] );
out.print(pushBodyCountVar);
}
out.println());
  @@ -1359,9 +1359,9 @@
generateSetters(n, tagHandlerVar, handlerInfo);

   if (n.implementsTryCatchFinally()) {
  - out.printin(int );
  + out.printin(int[] );
out.print(tagPushBodyCountVar);
  - out.println( = 0;);
  + out.println( = new int[] { 0 };);
   out.printil(try {);
   out.pushIndent();
   }
  @@ -1396,10 +1396,10 @@
out.printil(javax.servlet.jsp.tagext.BodyContent _bc = 
pageContext.pushBody(););
if (n.implementsTryCatchFinally()) {
out.printin(tagPushBodyCountVar);
  - out.println(++;);
  + out.println([0]++;);
} else if (pushBodyCountVar != null) {
out.printin(pushBodyCountVar);
  - out.println(++;);
  + out.println([0]++;);
}
out.printil(out = _bc;);
   
  @@ -1464,10 +1464,10 @@
   out.printil(out = pageContext.popBody(););
if (n.implementsTryCatchFinally()) {
out.printin(tagPushBodyCountVar);
  - out.println(--;);
  + out.println([0]--;);
} else if (pushBodyCountVar != null) {
out.printin(pushBodyCountVar);
  - out.println(--;);
  + out.println([0]--;);
}
out.popIndent();
}
  @@ -1494,7 +1494,7 @@
   
out.printin(while ();
out.print(tagPushBodyCountVar);
  - out.println(--  0));
  + out.println([0]--  0));
out.pushIndent();
out.printil(out = pageContext.popBody(););
out.popIndent();
  
  
  

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

2004-04-05 Thread luehe
luehe   2004/04/05 09:07:41

  Modified:jasper2/src/share/org/apache/jasper/compiler Generator.java
  Log:
  Moved initialization of 'varName' to where it is needed
  
  Revision  ChangesPath
  1.231 +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.230
  retrieving revision 1.231
  diff -u -r1.230 -r1.231
  --- Generator.java27 Mar 2004 00:52:55 -  1.230
  +++ Generator.java5 Apr 2004 16:07:41 -   1.231
  @@ -2529,11 +2529,11 @@
   for (int i = 0; i  varInfos.length; i++) {
   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 varName = varInfos[i].getVarName();
   String tmpVarName =
   _jspx_ + varName + _ + n.getCustomNestingLevel();
   out.printin(varName);
  
  
  

-
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-25 Thread luehe
luehe   2004/03/25 13:44:35

  Modified:jasper2/src/share/org/apache/jasper/compiler Generator.java
  Log:
  Fixed Bugzilla 27948 (NPE with null fragment)
  
  Revision  ChangesPath
  1.228 +8 -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.227
  retrieving revision 1.228
  diff -u -r1.227 -r1.228
  --- Generator.java24 Mar 2004 21:05:26 -  1.227
  +++ Generator.java25 Mar 2004 21:44:35 -  1.228
  @@ -1986,12 +1986,15 @@
   
   n.setBeginJavaLine(out.getJavaLine());
   
  +// Invoke fragment, unless fragment is null
  +out.printin(if ();
  +out.print(toGetterMethod(n.getTextAttribute(fragment)));
  +out.println( != null) {);
  +out.pushIndent();
   // Copy virtual page scope of tag file to page scope of invoking
   // page
   out.printil(
   ((org.apache.jasper.runtime.JspContextWrapper) 
this.jspContext).syncBeforeInvoke(););
  -
  -// Invoke fragment
   String varReaderAttr = n.getTextAttribute(varReader);
   String varAttr = n.getTextAttribute(var);
   if (varReaderAttr != null || varAttr != null) {
  @@ -2020,6 +2023,9 @@
   }
   out.println(););
   }
  +
  +out.popIndent();
  +out.printil(});
   
   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

2004-03-25 Thread luehe
luehe   2004/03/25 13:53:13

  Modified:jasper2/src/share/org/apache/jasper/compiler Generator.java
  Log:
  Fixed Bugzilla 27948 (NPE with null fragment)
  
  Revision  ChangesPath
  1.229 +8 -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.228
  retrieving revision 1.229
  diff -u -r1.228 -r1.229
  --- Generator.java25 Mar 2004 21:44:35 -  1.228
  +++ Generator.java25 Mar 2004 21:53:12 -  1.229
  @@ -1986,11 +1986,6 @@
   
   n.setBeginJavaLine(out.getJavaLine());
   
  -// Invoke fragment, unless fragment is null
  -out.printin(if ();
  -out.print(toGetterMethod(n.getTextAttribute(fragment)));
  -out.println( != null) {);
  -out.pushIndent();
   // Copy virtual page scope of tag file to page scope of invoking
   // page
   out.printil(
  @@ -2002,8 +1997,16 @@
   } else {
   out.printil(_jspx_sout = null;);
   }
  +
  +// Invoke fragment, unless fragment is null
  +out.printin(if ();
  +out.print(toGetterMethod(n.getTextAttribute(fragment)));
  +out.println( != null) {);
  +out.pushIndent();
   out.printin(toGetterMethod(n.getTextAttribute(fragment)));
   out.println(.invoke(_jspx_sout););
  +out.popIndent();
  +out.printil(});
   
   // Store varReader in appropriate scope
   if (varReaderAttr != null || varAttr != null) {
  @@ -2023,9 +2026,6 @@
   }
   out.println(););
   }
  -
  -out.popIndent();
  -out.printil(});
   
   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

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-jasper/jasper2/src/share/org/apache/jasper/compiler Generator.java

2004-03-22 Thread luehe
luehe   2004/03/22 17:56:40

  Modified:jasper2/src/share/org/apache/jasper/compiler Generator.java
  Log:
  Return 500 error code if JSP error page mechanism is invoked (the current impl used 
to return 200)
  
  Revision  ChangesPath
  1.226 +6 -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.225
  retrieving revision 1.226
  diff -u -r1.225 -r1.226
  --- Generator.java23 Mar 2004 00:06:07 -  1.225
  +++ Generator.java23 Mar 2004 01:56:39 -  1.226
  @@ -556,6 +556,12 @@
   if (pageInfo.isErrorPage()) {
   out.printil(
   Throwable exception = 
org.apache.jasper.runtime.JspRuntimeLibrary.getThrowable(request););
  +out.printil(if (exception != null) {);
  +out.pushIndent();
  +out.printil(
  +
response.setStatus(HttpServletResponse.SC_INTERNAL_SERVER_ERROR););
  +out.popIndent();
  +out.printil(});
   }
   
   out.printil(ServletContext application = 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-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 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 Generator.java

2004-02-03 Thread remm
remm2004/02/03 00:27:43

  Modified:jasper2/src/share/org/apache/jasper/compiler Generator.java
  Log:
  - Revert patch.
  
  Revision  ChangesPath
  1.218 +32 -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.217
  retrieving revision 1.218
  diff -u -r1.217 -r1.218
  --- Generator.java2 Feb 2004 18:18:00 -   1.217
  +++ Generator.java3 Feb 2004 08:27:43 -   1.218
  @@ -1261,37 +1261,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]



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

2004-02-03 Thread Remy Maucherat
Mark Roth wrote:
Okay, I took a look at the patch and the bug report and I think I know 
what's going on now.  Please let me know if I do not understand the 
scenario correctly.

It seems there are some JSP 1.2 pages that misuse jsp:useBean by doing 
one of the following:

  1. The class attribute is used for a Java type that cannot
 be instantiated as a JavaBean.
  2. Type or class specifies a type that cannot be found.
There are some cases where pages can get away with (1) if the container 
decides to flag this as a runtime error.  These pages are invalid but 
the container never calls them on it because the objects already exist 
in some scope.  This is probably less likely with (2), but still 
possible (e.g. if the jsp:useBean never gets executed at all).

It would be nice to get a translation error in this case so that you 
realize your page is invalid.  However, the JSP 1.2 specification (on 
which Tomcat 4.x is based) does not allow for a translation error - it 
requires that a runtime exception must be thrown.

In JSP 2.0 (on which Tomcat 5.x is based), a number of JSP container 
vendors complained about this and wanted the freedom to throw a 
translation error in this case.  Doing so is better for the page author 
(since they know up front their page is invalid) and better for the 
container (since doing a 'new' is MUCH more efficient than doing a call 
to Beans.instantiate()).  So, we added a provision to allow containers 
to optionally produce a translation error on these invalid pages.

One unfortunate side-effect is that some pages that used to compile in 
Tomcat 4 will no longer compile in Tomcat 5.  But it's important to 
realize that these pages are invalid in both specs.  It's just that 
Tomcat 4 was not allowed to cause an error at translation time.  It had 
to wait until runtime to do so.

So where does this leave us with respect to this patch?  Tomcat 5 is 
free to exhibit either behavior.  It can throw a translation error or a 
runtime error for these invalid pages.  In my opinion, it is much better 
for both the page author and the container if we produce a 
translation-time error.  The page author knows their page is invalid 
right away (without having to exercise the code path), and the container 
can gain the performance benefits associated with doing a 'new' call 
directly (instead of Beans.instantiate()).

So it's your call, but if I had a vote I'd say stick with Kin-Man's patch.

Hope this helps.
Thanks for the explanations :)

Rémy

-
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-02 Thread remm
remm2004/02/02 10:18:01

  Modified:jasper2/src/share/org/apache/jasper/compiler Generator.java
  Log:
  - Revert useBean optimization done by Kin-Man, as it seems to violate the
spec wording (which basically says that an error should occur at runtime if the 
class
is not a JavaBean).
  - Bug 26507.
  
  Revision  ChangesPath
  1.217 +31 -35
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.216
  retrieving revision 1.217
  diff -u -r1.216 -r1.217
  --- Generator.java31 Jan 2004 01:56:28 -  1.216
  +++ Generator.java2 Feb 2004 18:18:00 -   1.217
  @@ -1261,41 +1261,37 @@
   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
  -// Generate codes to instantiate the bean class
  -out.printin(name);
  -out.print( = new );
  -out.print(klass);
  -out.println((););
  +className = quote(klass);
   }
  +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]



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

2004-02-02 Thread Kin-Man Chung
-1.

Remy, please reread JSP 2.0 spec, p 1-101,1-102.  Bullet .2 of the Semantics
section was added to allow for this kind of optimization.  Bullet .5 and .6
will be executed ONLY IF the container choose not to issue translation errors.

-Kin-man

 Date: Mon, 02 Feb 2004 18:18:01 +
 From: [EMAIL PROTECTED]
 Subject: cvs commit: 
jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/compiler 
Generator.java
 To: [EMAIL PROTECTED]
 
 remm2004/02/02 10:18:01
 
   Modified:jasper2/src/share/org/apache/jasper/compiler Generator.java
   Log:
   - Revert useBean optimization done by Kin-Man, as it seems to violate the
 spec wording (which basically says that an error should occur at runtime 
if the class
 is not a JavaBean).
   - Bug 26507.
   
   Revision  ChangesPath
   1.217 +31 -35
jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/compiler/Generator.jav
a
   
   Index: Generator.java
   ===
   RCS file: 
/home/cvs/jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/compiler/Gen
erator.java,v
   retrieving revision 1.216
   retrieving revision 1.217
   diff -u -r1.216 -r1.217
   --- Generator.java  31 Jan 2004 01:56:28 -  1.216
   +++ Generator.java  2 Feb 2004 18:18:00 -   1.217
   @@ -1261,41 +1261,37 @@
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
   -// Generate codes to instantiate the bean class
   -out.printin(name);
   -out.print( = new );
   -out.print(klass);
   -out.println((););
   +className = quote(klass);
}
   +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]
 


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

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

2004-02-02 Thread Remy Maucherat
Kin-Man Chung wrote:
-1.

Remy, please reread JSP 2.0 spec, p 1-101,1-102.  Bullet .2 of the Semantics
section was added to allow for this kind of optimization.  Bullet .5 and .6
will be executed ONLY IF the container choose not to issue translation errors.
I cannot really understand what the fragment really means, so I don't 
know. I had the impression that it implied that the error should be at 
runtime.
I recommend the change is reverted as I did, as many users will likely 
make the same mistake, since the specification is impossible to 
understand (if you are right and your change indeed does not break the 
specification). This will also create compilation errors when upgrading 
from TC 4 to TC 5.

Rémy

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


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

2004-02-02 Thread Kin-Man Chung
Agreed that the spec can be clearer.  :-)

This has been discussed by the Spec expert group, and bullet .2 was added
because some vendors wanted it.  I'll check with the spec lead for a
clarification.

Also agreed that this breaks backward compatibility; but it not really too
bad.  I think a lot of users would rather have the error at compilation
time than at runtime.  What can you do with an instantiation error at
runtime?

If we are really concern about BC, then we can add another compilation
option to revert to old behavior.  I really don't like another switch, but
if it'll make people happy...

-Kin-man

 Date: Mon, 02 Feb 2004 19:41:54 +0100
 From: Remy Maucherat [EMAIL PROTECTED]
 Subject: Re: cvs commit: 
jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/compiler 
Generator.java
 To: Tomcat Developers List [EMAIL PROTECTED]
 
 Kin-Man Chung wrote:
  -1.
  
  Remy, please reread JSP 2.0 spec, p 1-101,1-102.  Bullet .2 of the Semantics
  section was added to allow for this kind of optimization.  Bullet .5 and .6
  will be executed ONLY IF the container choose not to issue translation 
errors.
 
 I cannot really understand what the fragment really means, so I don't 
 know. I had the impression that it implied that the error should be at 
 runtime.
 I recommend the change is reverted as I did, as many users will likely 
 make the same mistake, since the specification is impossible to 
 understand (if you are right and your change indeed does not break the 
 specification). This will also create compilation errors when upgrading 
 from TC 4 to TC 5.
 
 Rémy
 
 
 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 


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



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

2004-02-02 Thread Remy Maucherat
Kin-Man Chung wrote:
Agreed that the spec can be clearer.  :-)

This has been discussed by the Spec expert group, and bullet .2 was added
because some vendors wanted it.  I'll check with the spec lead for a
clarification.
Ok.

Also agreed that this breaks backward compatibility; but it not really too
bad.  I think a lot of users would rather have the error at compilation
time than at runtime.  What can you do with an instantiation error at
runtime?
Nothing, but some don't care: they never intended their page to be 
called without the right attribute in the right scope, so the case where 
their JavaBean is instantiated never happens.

If we are really concern about BC, then we can add another compilation
option to revert to old behavior.  I really don't like another switch, but
if it'll make people happy...
No new switch, please ;) So we have to decide one or the other.
So do you want me to revert the patch ?
Rémy

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


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

2004-02-02 Thread Kin-Man Chung

 Date: Mon, 02 Feb 2004 20:17:29 +0100
 From: Remy Maucherat [EMAIL PROTECTED]
 Subject: Re: cvs commit: 
jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/compiler 
Generator.java
 To: Tomcat Developers List [EMAIL PROTECTED]
 
 Kin-Man Chung wrote:
  Agreed that the spec can be clearer.  :-)
  
  This has been discussed by the Spec expert group, and bullet .2 was added
  because some vendors wanted it.  I'll check with the spec lead for a
  clarification.
 
 Ok.
 
  Also agreed that this breaks backward compatibility; but it not really too
  bad.  I think a lot of users would rather have the error at compilation
  time than at runtime.  What can you do with an instantiation error at
  runtime?
 
 Nothing, but some don't care: they never intended their page to be 
 called without the right attribute in the right scope, so the case where 
 their JavaBean is instantiated never happens.

Then EL should be used in this case.

 
  If we are really concern about BC, then we can add another compilation
  option to revert to old behavior.  I really don't like another switch, but
  if it'll make people happy...
 
 No new switch, please ;) So we have to decide one or the other.
 So do you want me to revert the patch ?
 

I'd rather you check with me first before the patch, but since it is
already done, let's wait for the spec clarification before we do anything.
A revert on a revert would make us look really silly.  :-)

-Kin-man

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


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



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

2004-02-02 Thread Remy Maucherat
Kin-Man Chung wrote:
I'd rather you check with me first before the patch, but since it is
already done, let's wait for the spec clarification before we do anything.
A revert on a revert would make us look really silly.  :-)
This has been lying in BZ for a while, that's why I just patched.
Ok, I'll wait to revert it.
Rémy

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


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

2004-02-02 Thread Mark Roth
Hi Kin-Man,

I'm just about to look into this.  I'll try to have an answer for you by 
tonight.

- Mark

Kin-Man Chung wrote:
-1.

Remy, please reread JSP 2.0 spec, p 1-101,1-102.  Bullet .2 of the Semantics
section was added to allow for this kind of optimization.  Bullet .5 and .6
will be executed ONLY IF the container choose not to issue translation errors.
-Kin-man


Date: Mon, 02 Feb 2004 18:18:01 +
From: [EMAIL PROTECTED]
Subject: cvs commit: 
jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/compiler 
Generator.java

To: [EMAIL PROTECTED]

remm2004/02/02 10:18:01

 Modified:jasper2/src/share/org/apache/jasper/compiler Generator.java
 Log:
 - Revert useBean optimization done by Kin-Man, as it seems to violate the
   spec wording (which basically says that an error should occur at runtime 
if the class

   is not a JavaBean).
 - Bug 26507.
 
 Revision  ChangesPath
 1.217 +31 -35
jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/compiler/Generator.jav
a
 
 Index: Generator.java
 ===
 RCS file: 
/home/cvs/jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/compiler/Gen
erator.java,v
 retrieving revision 1.216
 retrieving revision 1.217
 diff -u -r1.216 -r1.217
 --- Generator.java	31 Jan 2004 01:56:28 -	1.216
 +++ Generator.java	2 Feb 2004 18:18:00 -	1.217
 @@ -1261,41 +1261,37 @@
  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
 -// Generate codes to instantiate the bean class
 -out.printin(name);
 -out.print( = new );
 -out.print(klass);
 -out.println((););
 +className = quote(klass);
  }
 +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]


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

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

2004-02-02 Thread Mark Roth
Okay, I took a look at the patch and the bug report and I think I know 
what's going on now.  Please let me know if I do not understand the 
scenario correctly.

It seems there are some JSP 1.2 pages that misuse jsp:useBean by doing 
one of the following:

  1. The class attribute is used for a Java type that cannot
 be instantiated as a JavaBean.
  2. Type or class specifies a type that cannot be found.
There are some cases where pages can get away with (1) if the container 
decides to flag this as a runtime error.  These pages are invalid but 
the container never calls them on it because the objects already exist 
in some scope.  This is probably less likely with (2), but still 
possible (e.g. if the jsp:useBean never gets executed at all).

It would be nice to get a translation error in this case so that you 
realize your page is invalid.  However, the JSP 1.2 specification (on 
which Tomcat 4.x is based) does not allow for a translation error - it 
requires that a runtime exception must be thrown.

In JSP 2.0 (on which Tomcat 5.x is based), a number of JSP container 
vendors complained about this and wanted the freedom to throw a 
translation error in this case.  Doing so is better for the page author 
(since they know up front their page is invalid) and better for the 
container (since doing a 'new' is MUCH more efficient than doing a call 
to Beans.instantiate()).  So, we added a provision to allow containers 
to optionally produce a translation error on these invalid pages.

One unfortunate side-effect is that some pages that used to compile in 
Tomcat 4 will no longer compile in Tomcat 5.  But it's important to 
realize that these pages are invalid in both specs.  It's just that 
Tomcat 4 was not allowed to cause an error at translation time.  It had 
to wait until runtime to do so.

So where does this leave us with respect to this patch?  Tomcat 5 is 
free to exhibit either behavior.  It can throw a translation error or a 
runtime error for these invalid pages.  In my opinion, it is much better 
for both the page author and the container if we produce a 
translation-time error.  The page author knows their page is invalid 
right away (without having to exercise the code path), and the container 
can gain the performance benefits associated with doing a 'new' call 
directly (instead of Beans.instantiate()).

So it's your call, but if I had a vote I'd say stick with Kin-Man's patch.

Hope this helps.

---
Mark Roth, Java Software
JSP 2.0 Co-Specification Lead
Sun Microsystems, Inc.


Remy Maucherat wrote:
Kin-Man Chung wrote:

Agreed that the spec can be clearer.  :-)

This has been discussed by the Spec expert group, and bullet .2 was added
because some vendors wanted it.  I'll check with the spec lead for a
clarification.


Ok.

Also agreed that this breaks backward compatibility; but it not really 
too
bad.  I think a lot of users would rather have the error at compilation
time than at runtime.  What can you do with an instantiation error at
runtime?


Nothing, but some don't care: they never intended their page to be 
called without the right attribute in the right scope, so the case where 
their JavaBean is instantiated never happens.

If we are really concern about BC, then we can add another compilation
option to revert to old behavior.  I really don't like another switch, 
but
if it'll make people happy...


No new switch, please ;) So we have to decide one or the other.
So do you want me to revert the patch ?
Rémy

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


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


cvs commit: jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/compiler 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/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-jasper/jasper2/src/share/org/apache/jasper/compiler Generator.java

2003-10-10 Thread luehe
luehe   2003/10/10 10:40:39

  Modified:jasper2/src/share/org/apache/jasper/compiler Generator.java
  Log:
  Quote value of 'classid' attribute
  
  Revision  ChangesPath
  1.213 +11 -18
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.212
  retrieving revision 1.213
  diff -u -r1.212 -r1.213
  --- Generator.java22 Sep 2003 21:01:21 -  1.212
  +++ Generator.java10 Oct 2003 17:40:38 -  1.213
  @@ -1449,9 +1449,8 @@
   // IE style plugin
   // OBJECT ...
   // First compose the runtime output string 
  -String s0 =
  -OBJECT classid=
  -+ ctxt.getOptions().getIeClassId()
  +String s0 = OBJECT
  ++ makeAttr(classid, ctxt.getOptions().getIeClassId())
   + makeAttr(name, name);
   
   String s1 = ;
  @@ -1464,8 +1463,7 @@
   s2 =  + \ height= +  + heightStr +  + \;
   }
   
  -String s3 =
  -makeAttr(hspace, hspace)
  +String s3 = makeAttr(hspace, hspace)
   + makeAttr(vspace, vspace)
   + makeAttr(align, align)
   + makeAttr(codebase, iepluginurl)
  @@ -1483,8 +1481,7 @@
   
   // PARAM  for java_codebase
   if (codebase != null) {
  -s0 =
  -PARAM name=\java_codebase\
  +s0 = PARAM name=\java_codebase\
   + makeAttr(value, codebase)
   + '';
   out.printil(out.write( + quote(s0) + ););
  @@ -1493,8 +1490,7 @@
   
   // PARAM  for java_archive
   if (archive != null) {
  -s0 =
  -PARAM name=\java_archive\
  +s0 = PARAM name=\java_archive\
   + makeAttr(value, archive)
   + '';
   out.printil(out.write( + quote(s0) + ););
  @@ -1502,8 +1498,7 @@
   }
   
   // PARAM  for type
  -s0 =
  -PARAM name=\type\
  +s0 = PARAM name=\type\
   + makeAttr(
   value,
   application/x-java-
  @@ -1527,8 +1522,7 @@
*/
   out.printil(out.write( + quote(COMMENT) + ););
   out.printil(out.write(\\\n\););
  -s0 =
  -EMBED
  +s0 = EMBED
   + makeAttr(
   type,
   application/x-java-
  @@ -1541,8 +1535,7 @@
   
   // s1 and s2 are the same as before.
   
  -s3 =
  -makeAttr(hspace, hspace)
  +s3 = makeAttr(hspace, hspace)
   + makeAttr(vspace, vspace)
   + makeAttr(align, align)
   + makeAttr(pluginspage, nspluginurl)
  
  
  

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



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

2003-09-22 Thread Kin-Man Chung
The actual mapping before we optimize the smap is

1:41
2:42
6:43
6:44
8:45
8:46

which looks OK to me.  But since we only do the smap at the beginnig of
the template text, and assume the the input line count is 1, the result is
what you have noticed.

I'll see if I can add some code to compute the input line ranges, but
it is going to be messy.  :(

But really, all this is more academic than useful in practice: who do
you think may need to single step over template text lines?  :-)

-Kin-man

 Date: Sat, 20 Sep 2003 00:18:14 -0700
 From: Eric Carmichael [EMAIL PROTECTED]
 Subject: Re: cvs commit: 
jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/compiler 
Generator.java Node.java SmapStratum.java SmapUtil.java
 X-Originating-IP: [64.203.49.21]
 To: Tomcat Developers List [EMAIL PROTECTED]
 X-MIMEOLE: Produced By Microsoft MimeOLE V6.00.2800.1165
 X-Priority: 3
 X-MSMail-priority: Normal
 X-Originating-Email: [EMAIL PROTECTED]
 X-OriginalArrivalTime: 20 Sep 2003 07:18:18.0787 (UTC) 
FILETIME=[5DB22F30:01C37F47]
 
 cal/cal1.jsp from the jsp-examples webapp starts like this:
 
 HTML
 !-- 
   Copyright (c) 1999 The Apache Software Foundation. All rights 
   reserved.
 --
 HEADTITLE 
 
 Before this commit, cal1.jsp's SMAP started like this:
 
 *L
 1,2:41
 3:42
 4:42
 5:42
 6:43,2
 
 Now it starts like this:
 
 *L
 1,2:41
 6:43,2
 
 I think the reason lines 3, 4, and 5 aren't being SMAPped is that you only add 
LineInfos inside if (breakAtLF || count  0) {.  This adds LineInfos when the 
output line advances, but not when the input line alone advances.  To SMAP 
template text fully, you have to add a LineInfo every time the line number 
advances in the input file or the output file.
 
 Eric
 
 
 - Original Message - 
 From: [EMAIL PROTECTED]
 To: [EMAIL PROTECTED]
 Sent: Tuesday, September 16, 2003 10:46 AM
 Subject: cvs commit: 
jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/compiler 
Generator.java Node.java SmapStratum.java SmapUtil.java
 
 
  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.jav
a

Index: Generator.java
===
RCS file: 
/home/cvs/jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/compiler/Gen
erator.java,v
retrieving revision 1.207
retrieving revision 1.208
diff -u -r1.207 -r1.208
--- Generator.java 15 Sep 2003 13:43:54 - 1.207
+++ Generator.java 16 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

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

2003-09-22 Thread Kin-Man Chung
Eric,

I forgot about those generated Declartions.  It good to have an extra
pair of eyes to keep one honest.  Thanks.  :)

I have committed a fix for this and the last you reported.  Please see if
it works better now.  I have noticed that smap now contains lots of
overlaps, because of duplications in the unoptimized smap.  I'll leave
to you as an exercise to remove them in smap optimizations  :-)  Enough
smap for me for the time being.

-Kin-man

 Date: Sat, 20 Sep 2003 00:45:21 -0700
 From: Eric Carmichael [EMAIL PROTECTED]
 Subject: Re: cvs commit: 
jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/compiler 
Generator.java
 X-Originating-IP: [64.203.49.21]
 To: Tomcat Developers List [EMAIL PROTECTED]
 X-MIMEOLE: Produced By Microsoft MimeOLE V6.00.2800.1165
 X-Priority: 3
 X-MSMail-priority: Normal
 X-Originating-Email: [EMAIL PROTECTED]
 X-OriginalArrivalTime: 20 Sep 2003 07:45:25.0789 (UTC) 
FILETIME=[2776FCD0:01C37F4B]
 
 This SMAPs all declaration nodes, including the ones tacked on to the root 
node by ELFunctionMapper.java.  So for instance the SMAP for 
jsp2/el/functions.jsp from the jsp-examples webapp ends with
 
 43,6:120
 1,3:10
 1,5:13
 
 thus SMAPping 
 
   %@ taglib prefix=my 
uri=http://jakarta.apache.org/tomcat/jsp2-example-taglib%
 
 to
 
   static private org.apache.jasper.runtime.ProtectedFunctionMapper 
_jspx_fnmap_0;
   static private org.apache.jasper.runtime.ProtectedFunctionMapper 
_jspx_fnmap_1;
 
 and
 
   static {
 _jspx_fnmap_0= 
org.apache.jasper.runtime.ProtectedFunctionMapper.getMapForFunction(my:reverse
, jsp2.examples.el.Functions.class, reverse, new Class[] 
{java.lang.String.class});
 _jspx_fnmap_1= 
org.apache.jasper.runtime.ProtectedFunctionMapper.getMapForFunction(my:countVow
els, jsp2.examples.el.Functions.class, numVowels, new Class[] 
{java.lang.String.class});
   }
 
 which is clearly wrong.
 
 Eric
 
 - Original Message - 
 From: [EMAIL PROTECTED]
 To: [EMAIL PROTECTED]
 Sent: Friday, September 19, 2003 4:38 PM
 Subject: cvs commit: 
jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/compiler 
Generator.java
 
 
  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.jav
a

Index: Generator.java
===
RCS file: 
/home/cvs/jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/compiler/Gen
erator.java,v
retrieving revision 1.210
retrieving revision 1.211
diff -u -r1.210 -r1.211
--- Generator.java 19 Sep 2003 18:30:09 - 1.210
+++ Generator.java 19 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]
  
  


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



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

2003-09-22 Thread Eric Carmichael
 But really, all this is more academic than useful in practice: who do
 you think may need to single step over template text lines?  :-)

No idea.  I'm just trying to make sure Bugzilla 22006 stays fixed.  On the
other hand if you want to WONTFIX that bad boy, I guess I don't have any
good grounds for objecting; the SMAP spec doesn't seem to say anywhere that
SMAPs need to be complete (or even non-empty?  Now there's a way to save
ourselves a bunch of work...).

I see from another message that you've committed a fix for this.  I'll test
your code when I get a chance.

Eric


- Original Message - 
From: Kin-Man Chung [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Monday, September 22, 2003 1:00 PM
Subject: Re: cvs commit:
jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/compiler
Generator.java Node.java SmapStratum.java SmapUtil.java


 The actual mapping before we optimize the smap is

 1:41
 2:42
 6:43
 6:44
 8:45
 8:46

 which looks OK to me.  But since we only do the smap at the beginnig of
 the template text, and assume the the input line count is 1, the result is
 what you have noticed.

 I'll see if I can add some code to compute the input line ranges, but
 it is going to be messy.  :(

 But really, all this is more academic than useful in practice: who do
 you think may need to single step over template text lines?  :-)

 -Kin-man

  Date: Sat, 20 Sep 2003 00:18:14 -0700
  From: Eric Carmichael [EMAIL PROTECTED]
  Subject: Re: cvs commit:
 jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/compiler
 Generator.java Node.java SmapStratum.java SmapUtil.java
  X-Originating-IP: [64.203.49.21]
  To: Tomcat Developers List [EMAIL PROTECTED]
  X-MIMEOLE: Produced By Microsoft MimeOLE V6.00.2800.1165
  X-Priority: 3
  X-MSMail-priority: Normal
  X-Originating-Email: [EMAIL PROTECTED]
  X-OriginalArrivalTime: 20 Sep 2003 07:18:18.0787 (UTC)
 FILETIME=[5DB22F30:01C37F47]
 
  cal/cal1.jsp from the jsp-examples webapp starts like this:
 
  HTML
  !-- 
Copyright (c) 1999 The Apache Software Foundation. All rights
reserved.
  --
  HEADTITLE
 
  Before this commit, cal1.jsp's SMAP started like this:
 
  *L
  1,2:41
  3:42
  4:42
  5:42
  6:43,2
 
  Now it starts like this:
 
  *L
  1,2:41
  6:43,2
 
  I think the reason lines 3, 4, and 5 aren't being SMAPped is that you
only add
 LineInfos inside if (breakAtLF || count  0) {.  This adds LineInfos
when the
 output line advances, but not when the input line alone advances.  To SMAP
 template text fully, you have to add a LineInfo every time the line number
 advances in the input file or the output file.
 
  Eric
 
 
  - Original Message - 
  From: [EMAIL PROTECTED]
  To: [EMAIL PROTECTED]
  Sent: Tuesday, September 16, 2003 10:46 AM
  Subject: cvs commit:
 jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/compiler
 Generator.java Node.java SmapStratum.java SmapUtil.java
 
 
   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
.jav
 a
  
 Index: Generator.java
 ===
 RCS file:

/home/cvs/jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/compiler
/Gen
 erator.java,v
 retrieving revision 1.207
 retrieving revision 1.208
 diff -u -r1.207 -r1.208
 --- Generator.java 15 Sep 2003 13:43:54 - 1.207
 +++ Generator.java 16 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

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

2003-09-20 Thread Eric Carmichael
cal/cal1.jsp from the jsp-examples webapp starts like this:

HTML
!-- 
  Copyright (c) 1999 The Apache Software Foundation. All rights 
  reserved.
--
HEADTITLE 

Before this commit, cal1.jsp's SMAP started like this:

*L
1,2:41
3:42
4:42
5:42
6:43,2

Now it starts like this:

*L
1,2:41
6:43,2

I think the reason lines 3, 4, and 5 aren't being SMAPped is that you only add 
LineInfos inside if (breakAtLF || count  0) {.  This adds LineInfos when the output 
line advances, but not when the input line alone advances.  To SMAP template text 
fully, you have to add a LineInfo every time the line number advances in the input 
file or the output file.

Eric


- Original Message - 
From: [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Tuesday, September 16, 2003 10:46 AM
Subject: cvs commit: 
jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/compiler Generator.java 
Node.java SmapStratum.java SmapUtil.java


 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.java 15 Sep 2003 13:43:54 - 1.207
   +++ Generator.java 16 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

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

2003-09-20 Thread Eric Carmichael
This SMAPs all declaration nodes, including the ones tacked on to the root node by 
ELFunctionMapper.java.  So for instance the SMAP for jsp2/el/functions.jsp from the 
jsp-examples webapp ends with

43,6:120
1,3:10
1,5:13

thus SMAPping 

  %@ taglib prefix=my uri=http://jakarta.apache.org/tomcat/jsp2-example-taglib%

to

  static private org.apache.jasper.runtime.ProtectedFunctionMapper _jspx_fnmap_0;
  static private org.apache.jasper.runtime.ProtectedFunctionMapper _jspx_fnmap_1;

and

  static {
_jspx_fnmap_0= 
org.apache.jasper.runtime.ProtectedFunctionMapper.getMapForFunction(my:reverse, 
jsp2.examples.el.Functions.class, reverse, new Class[] {java.lang.String.class});
_jspx_fnmap_1= 
org.apache.jasper.runtime.ProtectedFunctionMapper.getMapForFunction(my:countVowels, 
jsp2.examples.el.Functions.class, numVowels, new Class[] {java.lang.String.class});
  }

which is clearly wrong.

Eric

- Original Message - 
From: [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Friday, September 19, 2003 4:38 PM
Subject: cvs commit: 
jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/compiler Generator.java


 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.java 19 Sep 2003 18:30:09 - 1.210
   +++ Generator.java 19 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-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-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-15 Thread ecarmich
ecarmich2003/09/15 06:43:54

  Modified:jasper2/src/share/org/apache/jasper/compiler Generator.java
  Log:
  Fix SMAPping for small text strings with genStrAsCharArray=false
  
  Revision  ChangesPath
  1.207 +18 -18
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.206
  retrieving revision 1.207
  diff -u -r1.206 -r1.207
  --- Generator.java10 Sep 2003 23:11:56 -  1.206
  +++ Generator.java15 Sep 2003 13:43:54 -  1.207
  @@ -1867,22 +1867,22 @@
   return;
   }
   
  -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  2) {
  -out.printil(out.write( + quote(text.charAt(2)) + ););
  -}
  -n.setEndJavaLine(out.getJavaLine());
  -return;
  -}
  -
   if (ctxt.getOptions().genStringAsCharArray()) {
  -// Generate Strings as char arrays, for performance
  +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  2) {
  +   out.printil(out.write( + quote(text.charAt(2)) + ););
  +   }
  +   n.setEndJavaLine(out.getJavaLine());
  +   return;
  +   }
  +
  +   // Generate Strings as char arrays, for performance
   ServletWriter caOut;
   if (charArrayBuffer == null) {
   charArrayBuffer = new GenBuffer(null);
  
  
  

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



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

2003-09-11 Thread Remy Maucherat
[EMAIL PROTECTED] wrote:
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.
The problem was when the expression was null, if I remember well the 
original justification for String.valueOf (of course, it is IMO 
acceptable to raise a NPE).

Remy

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


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

2003-09-11 Thread Kin-Man Chung
Yeah, now I remember; but I didn't pay attention then!  :-)

Anyway, the print methods handle null String and Object, so we are covered.
This is true for outputting expressions in text mode; evaluating attributes
with expressions is, however, another matter.

BTW, I also think it acceptable to raise NPE.  Let's leave print's in
until someone else objects!  :-)

-Kin-man

 Date: Thu, 11 Sep 2003 08:53:36 +0200
 From: Remy Maucherat [EMAIL PROTECTED]
 Subject: Re: cvs commit: 
jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/compiler 
Generator.java
 To: Tomcat Developers List [EMAIL PROTECTED]
 
 [EMAIL PROTECTED] wrote:
  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.
 
 The problem was when the expression was null, if I remember well the 
 original justification for String.valueOf (of course, it is IMO 
 acceptable to raise a NPE).
 
 Remy
 
 
 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 


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



cvs commit: jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/compiler 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-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(} 

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

2003-09-02 Thread ecarmich
ecarmich2003/09/01 22:50:47

  Modified:jasper2/src/share/org/apache/jasper/compiler Generator.java
  Log:
  Expand wildcard imports
  Remove unused imports
  Remove tabs
  
  Revision  ChangesPath
  1.202 +3044 
-2823jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/compiler/Generator.java
  
  
http://cvs.apache.org/viewcvs/jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/compiler/Generator.java.diff?r1=1.201r2=1.202
  
  

-
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-08-22 Thread luehe
luehe   2003/08/22 12:42:58

  Modified:jasper2/src/share/org/apache/jasper/compiler Generator.java
  Log:
  Avoid defining multiple getServletInfo() methods (one for each page
  directive with an 'info' attribute)
  
  Revision  ChangesPath
  1.201 +22 -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.200
  retrieving revision 1.201
  diff -u -r1.200 -r1.201
  --- Generator.java22 Aug 2003 00:07:32 -  1.200
  +++ Generator.java22 Aug 2003 19:42:58 -  1.201
  @@ -148,7 +148,24 @@
   
class DeclarationVisitor extends Node.Visitor {
   
  +private boolean getServletInfoGenerated = false;
  +
  +/*
  + * Generates getServletInfo() method that returns the value of the
  + * page directive's 'info' attribute, if present.
  + *
  + * The Validator has already ensured that if the translation unit
  + * contains more than one page directive with an 'info' attribute,
  + * their values match.
  + */
public void visit(Node.PageDirective n) throws JasperException {
  +
  +if (!getServletInfoGenerated) {
  +getServletInfoGenerated = true;
  +} else {
  +return;
  +}
  +
String info = n.getAttributeValue(info);
if (info == null)
return;
  @@ -156,10 +173,10 @@
out.printil(public String getServletInfo() {);
out.pushIndent();
out.printin(return );
  - out.print  (quote(info));
  + out.print(quote(info));
out.println(;);
out.popIndent();
  - out.print  ('}');
  + out.printil(});
out.println();
}
   
  
  
  

-
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-08-21 Thread kinman
kinman  2003/08/21 16:59:11

  Modified:jasper2/src/share/org/apache/jasper/compiler Generator.java
  Log:
  - Don't generate code to do an instanceof when it can be done at
translation.
  - Minor code cleanup in the codes generated for fragments.
  
  Revision  ChangesPath
  1.199 +28 -33
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.198
  retrieving revision 1.199
  diff -u -r1.198 -r1.199
  --- Generator.java20 Aug 2003 16:37:10 -  1.198
  +++ Generator.java21 Aug 2003 23:59:11 -  1.199
  @@ -688,6 +688,7 @@
   
private Hashtable tagVarNumbers;
private String parent;
  + private boolean isSimpleTagParent;  // Is parent a SimpleTag?
private String pushBodyCountVar;
private String simpleTagHandlerVar;
private boolean isSimpleTagHandler;
  @@ -1558,6 +1559,8 @@
// visit body
String tmpParent = parent;
parent = tagHandlerVar;
  + boolean isSimpleTagParentSave = isSimpleTagParent;
  + isSimpleTagParent = false;
String tmpPushBodyCountVar = null;
if (n.implementsTryCatchFinally()) {
tmpPushBodyCountVar = pushBodyCountVar;
  @@ -1569,6 +1572,7 @@
visitBody(n);
   
parent = tmpParent;
  + isSimpleTagParent = isSimpleTagParentSave;
if (n.implementsTryCatchFinally()) {
pushBodyCountVar = tmpPushBodyCountVar;
}
  @@ -2540,30 +2544,21 @@
   
// Set parent
if (!simpleTag) {
  + out.printin(tagHandlerVar);
  + out.print(.setParent();
if (parent != null) {
  - out.printin(if ();
  - out.print(parent);
  - out.println( instanceof javax.servlet.jsp.tagext.SimpleTag));
  - out.pushIndent();
  - out.printin(tagHandlerVar);
  - out.print(.setParent();
  - out.print(new javax.servlet.jsp.tagext.TagAdapter();
  - out.print((javax.servlet.jsp.tagext.SimpleTag) );
  - out.print(parent);
  - out.println()););
  - out.popIndent();
  - out.printil(else);
  - out.pushIndent();
  - out.printin(tagHandlerVar);
  - out.print(.setParent((javax.servlet.jsp.tagext.Tag) );
  - out.print(parent);
  - out.println(););
  - out.popIndent();
  + if (isSimpleTagParent) {
  + out.print(new javax.servlet.jsp.tagext.TagAdapter();
  + out.print((javax.servlet.jsp.tagext.SimpleTag) );
  + out.print(parent);
  + out.println()););
  + } else {
  + out.print((javax.servlet.jsp.tagext.Tag) );
  + out.print(parent);
  + out.println(););
  + }
} else {
  - out.printin(tagHandlerVar);
  - out.print(.setParent();
  - out.print(parent);
  - out.println(););
  + out.println(null););
}
} else {
// The setParent() method need not be called if the value being
  @@ -2718,12 +2713,15 @@
   ServletWriter outSave = out;
out = fragment.getGenBuffer().getOut();
String tmpParent = parent;
  - parent = tagHandlerVar;
  + parent = _jspx_parent;
  + boolean isSimpleTagParentSave = isSimpleTagParent;
  + isSimpleTagParent = true;
boolean tmpIsFragment = isFragment;
isFragment = true;
   visitBody( n );
   out = outSave;
parent = tmpParent;
  + isSimpleTagParent = isSimpleTagParentSave;
isFragment = tmpIsFragment;
fragmentHelperClass.closeFragment(fragment, methodNesting);
   // XXX - Need to change pageContext to jspContext if
  @@ -3534,14 +3532,14 @@
   org.apache.jasper.runtime.JspFragmentHelper );
   out.printil( { );
   out.pushIndent();
  - out.printil(private javax.servlet.jsp.tagext.JspTag parentTag;);
  + out.printil(private javax.servlet.jsp.tagext.JspTag _jspx_parent;);
out.println();
   out.printil( public  + className + 
   ( int discriminator, JspContext jspContext,  +
  -javax.servlet.jsp.tagext.JspTag parentTag ) { );
  +

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

2003-08-21 Thread kinman
kinman  2003/08/21 17:07:32

  Modified:jasper2/src/share/org/apache/jasper/compiler Generator.java
  Log:
  - Remove obselete codes in comments.
  
  Revision  ChangesPath
  1.200 +3 -41 
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.199
  retrieving revision 1.200
  diff -u -r1.199 -r1.200
  --- Generator.java21 Aug 2003 23:59:11 -  1.199
  +++ Generator.java22 Aug 2003 00:07:32 -  1.200
  @@ -497,9 +497,6 @@
out.print  (servletClassName);
out.print  ( extends );
out.println(pageInfo.getExtends());
  -/* Supress until we also implement resolveFunction()
  - out.printil(implements javax.servlet.jsp.el.FunctionMapper, );
  -*/
out.printin(implements org.apache.jasper.runtime.JspSourceDependent);
if (!pageInfo.isThreadSafe()) {
out.println(,);
  @@ -550,11 +547,6 @@
// Number of tag object that need to be popped
// XXX TODO: use a better criteria
maxTagNesting = pageInfo.getMaxTagNesting();
  -/*
  -if (maxTagNesting  0) {
  - out.printil(JspxState _jspxState = new JspxState(););
  -}
  -*/
   out.printil(JspWriter _jspx_out = null;);
out.println();
   
  @@ -652,26 +644,6 @@
   }
   
   /**
  - * Generate codes defining the classes used in the servlet.
  - * 1. Servlet state object, used to pass servlet info round methods.
  - */
  -private void generateJspState() {
  -/*
  - out.println();
  - out.printil(static final class JspxState {);
  - out.pushIndent();
  - out.printil(public JspWriter out;);
  - out.println();
  - out.printil(public JspxState() {);
  - out.pushIndent();
  - out.popIndent();
  - out.printil(});
  - out.popIndent();
  - out.printil(});
  -*/
  -}
  -
  -/**
* A visitor that generates codes for the elements in the page.
*/
   class GenerateVisitor extends Node.Visitor {
  @@ -1501,7 +1473,6 @@
out.print(parent);
out.print(, );
}
  -//   out.println(pageContext, _jspxState));
out.print(pageContext);
if (pushBodyCountVar != null) {
out.print(, );
  @@ -1531,7 +1502,6 @@
out.print(parent);
out.print(, );
}
  -//   out.println(PageContext pageContext, JspxState _jspxState));
out.print(PageContext pageContext);
if (pushBodyCountVar != null) {
out.print(, int[] );
  @@ -2857,11 +2827,6 @@
   out.printMultiLn(fragmentHelperClass.toString());
   }
   
  - // generate class definition for JspxState
  -if (maxTagNesting  0) {
  - generateJspState();
  - }
  -
   // Close the class definition
   out.popIndent();
   out.printil(});
  @@ -3005,9 +2970,6 @@
out.printin(public final class );
out.println(className);
out.printil(extends javax.servlet.jsp.tagext.SimpleTagSupport);
  -/* Supress until we also implement resolveFunction()
  - out.printil(implements javax.servlet.jsp.el.FunctionMapper, );
  -*/
out.printin(implements org.apache.jasper.runtime.JspSourceDependent);
if (tagInfo.hasDynamicAttributes()) {
out.println(,);
  
  
  

-
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-08-20 Thread luehe
luehe   2003/08/20 09:37:10

  Modified:jasper2/src/share/org/apache/jasper/compiler Generator.java
  Log:
  Temporary hack. If a JSP page uses the extends attribute of the page
  directive, the _jspInit() method of the generated servlet class will
  not be called (it is only called for those generated servlets that
  extend HttpJspBase, the default), causing the tag handler pools not to
  be initialized and resulting in a NPE.
  
  The JSP spec needs to clarify whether containers can override init()
  and destroy(). For now, we just disable tag pooling for pages that use
  extends.
  
  Revision  ChangesPath
  1.198 +28 -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.197
  retrieving revision 1.198
  diff -u -r1.197 -r1.198
  --- Generator.java19 Aug 2003 00:36:35 -  1.197
  +++ Generator.java20 Aug 2003 16:37:10 -  1.198
  @@ -96,6 +96,7 @@
   private ErrorDispatcher err;
   private BeanRepository beanInfo;
   private JspCompilationContext ctxt;
  +private boolean isPoolingEnabled;
   private boolean breakAtLF;
   private PageInfo pageInfo;
   private int maxTagNesting;
  @@ -446,8 +447,7 @@
   private void genPreambleClassVariableDeclarations( String className ) 
   throws JasperException
   {
  - if (ctxt.getOptions().isPoolingEnabled()
  -  !tagHandlerPoolNames.isEmpty()) {
  + if (isPoolingEnabled  !tagHandlerPoolNames.isEmpty()) {
for (int i=0; itagHandlerPoolNames.size(); i++) {
out.printil(private org.apache.jasper.runtime.TagHandlerPool 
+ tagHandlerPoolNames.elementAt(i) + ;);
  @@ -471,8 +471,7 @@
   out.printil(});
   out.println();
   
  - if (ctxt.getOptions().isPoolingEnabled()
  -  !tagHandlerPoolNames.isEmpty()) {
  + if (isPoolingEnabled  !tagHandlerPoolNames.isEmpty()) {
generateInit();
generateDestroy();
}
  @@ -1927,7 +1926,7 @@
out.print( );
out.print(tagHandlerVar);
out.print( = );
  - if (ctxt.getOptions().isPoolingEnabled()) {
  + if (isPoolingEnabled) {
out.print(();
out.print(tagHandlerClass.getName());
out.print() );
  @@ -2091,7 +2090,7 @@
out.println(.doFinally(););
}
   
  - if (ctxt.getOptions().isPoolingEnabled()) {
  + if (isPoolingEnabled) {
   out.printin(n.getTagHandlerPoolName());
   out.print(.reuse();
out.print(tagHandlerVar);
  @@ -2916,9 +2915,25 @@
fragmentHelperClass = new FragmentHelperClass( 
   ctxt.getServletClassName() + Helper );
   pageInfo = compiler.getPageInfo();
  +
  +/*
  + * Temporary hack. If a JSP page uses the extends attribute of the
  + * page directive, the _jspInit() method of the generated servlet class
  + * will not be called (it is only called for those generated servlets
  + * that extend HttpJspBase, the default), causing the tag handler pools
  + * not to be initialized and resulting in a NPE.
  + * The JSP spec needs to clarify whether containers can override
  + * init() and destroy(). For now, we just disable tag pooling for pages
  + * that use extends.
  + */
  +if (pageInfo.getExtends(false) == null) {
  +isPoolingEnabled = ctxt.getOptions().isPoolingEnabled();
  +} else {
  +isPoolingEnabled = false;
  +}
beanInfo = pageInfo.getBeanRepository();
breakAtLF = ctxt.getOptions().getMappedFile();
  - if (ctxt.getOptions().isPoolingEnabled()) {
  + if (isPoolingEnabled) {
tagHandlerPoolNames = new Vector();
}
   }
  @@ -2934,7 +2949,7 @@
   
Generator gen = new Generator(out, compiler);
   
  -if (gen.ctxt.getOptions().isPoolingEnabled()) {
  +if (gen.isPoolingEnabled) {
   gen.compileTagHandlerPoolList(page);
   }
if (gen.ctxt.isTagFile()) {
  @@ -3062,8 +3077,7 @@
out.printil(javax.servlet.ServletConfig config =  +
   pageContext.getServletConfig(););
out.printil(javax.servlet.jsp.JspWriter out = jspContext.getOut(););
  - if (ctxt.getOptions().isPoolingEnabled()
  - !tagHandlerPoolNames.isEmpty()) {
  + if (isPoolingEnabled  !tagHandlerPoolNames.isEmpty()) {
out.printil(_jspInit(config););
}
generatePageScopedVariables(tagInfo);
  @@ -3099,8 +3113,7 @@
   out.printil( } finally { );
   out.pushIndent();
 

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

2003-08-18 Thread kinman
kinman  2003/08/18 17:36:35

  Modified:jasper2/src/share/org/apache/jasper/compiler Generator.java
Node.java
  Log:
  - Adjust Java lines mappings for codes that are generated in buffers.
The diff is more than was actually changed, due to a change of a class
name.
  
  Revision  ChangesPath
  1.197 +80 -32
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.196
  retrieving revision 1.197
  diff -u -r1.196 -r1.197
  --- Generator.java17 Aug 2003 21:54:36 -  1.196
  +++ Generator.java19 Aug 2003 00:36:35 -  1.197
  @@ -91,7 +91,7 @@
   
   private static final Class[] OBJECT_CLASS = { Object.class};
   private ServletWriter out;
  -private MethodsBuffer methodsBuffer;
  +private ArrayList methodsBuffered;
   private FragmentHelperClass fragmentHelperClass;
   private ErrorDispatcher err;
   private BeanRepository beanInfo;
  @@ -695,7 +695,7 @@
private boolean isFragment;
private boolean isTagFile;
private ServletWriter out;
  - private MethodsBuffer methodsBuffer;
  + private ArrayList methodsBuffered;
private FragmentHelperClass fragmentHelperClass;
private int methodNesting;
private TagInfo tagInfo;
  @@ -706,13 +706,13 @@
 */
public GenerateVisitor(boolean isTagFile,
   ServletWriter out, 
  -MethodsBuffer methodsBuffer, 
  +ArrayList methodsBuffered,
   FragmentHelperClass fragmentHelperClass,
   ClassLoader loader,
   TagInfo tagInfo) {
this.isTagFile = isTagFile;
this.out = out;
  - this.methodsBuffer = methodsBuffer;
  + this.methodsBuffered = methodsBuffered;
this.fragmentHelperClass = fragmentHelperClass;
this.loader = loader;
this.tagInfo = tagInfo;
  @@ -1485,7 +1485,6 @@
// If the tag contains no scripting element, generate its codes
// to a method.
ServletWriter outSave = null;
  - MethodsBuffer methodsBufferSave = null;
   Node.ChildInfo ci = n.getChildInfo();
if (ci.isScriptless()  !ci.hasScriptingVars()) {
// The tag handler and its body code can reside in a separate
  @@ -1515,9 +1514,10 @@
   
// Set up new buffer for the method
outSave = out;
  - out = methodsBuffer.getOut();
  - methodsBufferSave = methodsBuffer;
  - methodsBuffer = new MethodsBuffer();
  + GenBuffer genBuffer = new GenBuffer(
  + n.implementsSimpleTag()? null:n.getBody());
  + methodsBuffered.add(genBuffer);
  + out = genBuffer.getOut();
   
methodNesting++;
// Generate code for method declaration
  @@ -1590,12 +1590,7 @@
   
methodNesting--;
   
  - // Append any methods that got generated in the body to the
  - // current buffer
  - out.print(methodsBuffer.toString());
  -
  - // restore previous buffer
  - methodsBuffer = methodsBufferSave;
  + // restore previous writer
out = outSave;
}
   }
  @@ -2722,7 +2717,7 @@
   fragmentHelperClass.openFragment(n, tagHandlerVar,
 methodNesting);
   ServletWriter outSave = out;
  - out = fragment.getMethodsBuffer().getOut();
  + out = fragment.getGenBuffer().getOut();
String tmpParent = parent;
parent = tagHandlerVar;
boolean tmpIsFragment = isFragment;
  @@ -2851,12 +2846,17 @@
* Common part of postamble, shared by both servlets and tag files.
*/
   private void genCommonPostamble() {
  - // Append any methods that were generated
  - out.printMultiLn(methodsBuffer.toString());
  + // Append any methods that were generated in the buffer.
  + for (int i = 0; i  methodsBuffered.size(); i++) {
  + GenBuffer methodBuffer = (GenBuffer) methodsBuffered.get(i);
  + methodBuffer.adjustJavaLines(out.getJavaLine()-1);
  + out.printMultiLn(methodBuffer.toString());
  + }
   
   // Append the helper class
   if( fragmentHelperClass.isUsed() ) {
   fragmentHelperClass.generatePostamble();
  +fragmentHelperClass.adjustJavaLines(out.getJavaLine()-1);
   out.printMultiLn(fragmentHelperClass.toString());
   }
   
  @@ 

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

2003-08-17 Thread kinman
kinman  2003/08/17 14:54:36

  Modified:jasper2/src/share/org/apache/jasper/compiler Generator.java
  Log:
  - The out in the Fragment helper functions is now JspWriter instead of
java.io.Writer, so that it won't trigger errors when a fragment contains
include actions.
  
  Revision  ChangesPath
  1.196 +5 -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.195
  retrieving revision 1.196
  diff -u -r1.195 -r1.196
  --- Generator.java14 Aug 2003 21:16:52 -  1.195
  +++ Generator.java17 Aug 2003 21:54:36 -  1.196
  @@ -3515,7 +3515,7 @@
} else {
out.printin(public void invoke);
}
  - out.println(result.getId() + (  + java.io.Writer out )  );
  + out.println(result.getId() + (  + JspWriter out )  );
   out.pushIndent();
   // Note: Throwable required because methods like _jspx_meth_*
   // throw Throwable.
  @@ -3558,7 +3558,7 @@
   out.popIndent();
   out.printil( { );
   out.pushIndent();
  - out.printil( java.io.Writer out = null; );
  + out.printil( JspWriter out = null; );
   out.printil( if( writer != null ) { );
   out.pushIndent();
out.printil( out = this.jspContext.pushBody(writer); );
  
  
  

-
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 SmapStratum.java SmapUtil.java

2003-08-14 Thread remm
remm2003/08/09 12:19:37

  Modified:jasper2/src/share/org/apache/jasper/compiler Generator.java
JspUtil.java SmapStratum.java SmapUtil.java
  Log:
  - Bug 2006: Invalid SMAP line entries when running with mappedfile=true.
  - Submitted by Eric Carmichael (like the previous patch).
  
  Revision  ChangesPath
  1.194 +5 -7  
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.193
  retrieving revision 1.194
  diff -u -r1.193 -r1.194
  --- Generator.java3 Aug 2003 09:07:47 -   1.193
  +++ Generator.java9 Aug 2003 19:19:37 -   1.194
  @@ -1700,8 +1700,6 @@
}
}
   
  - private static final int CHUNKSIZE = 1024;
  -
public void visit(Node.TemplateText n) throws JasperException {
   
String text = n.getText();
  @@ -1711,7 +1709,7 @@
out.printin();
StringBuffer sb = new StringBuffer(out.write(\);
int initLength = sb.length();
  - int count = CHUNKSIZE;
  + int count = JspUtil.CHUNKSIZE;
for (int i = 0 ; i  text.length() ; i++) {
char ch = text.charAt(i);
--count;
  @@ -1736,7 +1734,7 @@
   out.printin();
   }
sb.setLength(initLength);
  - count = CHUNKSIZE;
  + count = JspUtil.CHUNKSIZE;
}
break;
case '\t':  // Not sure we need this
  
  
  
  1.42  +5 -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
  retrieving revision 1.41
  retrieving revision 1.42
  diff -u -r1.41 -r1.42
  --- JspUtil.java  8 Aug 2003 10:22:23 -   1.41
  +++ JspUtil.java  9 Aug 2003 19:19:37 -   1.42
  @@ -117,6 +117,8 @@
   this, throws, transient, try, void,
   volatile, while };
   
  +public static final int CHUNKSIZE = 1024;
  +
   public static char[] removeQuotes(char []chars) {
   CharArrayWriter caw = new CharArrayWriter();
   for (int i = 0; i  chars.length; i++) {
  
  
  
  1.6   +38 -0 
jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/compiler/SmapStratum.java
  
  Index: SmapStratum.java
  ===
  RCS file: 
/home/cvs/jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/compiler/SmapStratum.java,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- SmapStratum.java  31 Jul 2003 16:56:20 -  1.5
  +++ SmapStratum.java  9 Aug 2003 19:19:37 -   1.6
  @@ -205,6 +205,44 @@
   }

   /**
  + * Combines consecutive LineInfos wherever possible
  + */
  +public void optimizeLineSection() {
  +
  +//Incorporate each LineInfo into the previous LineInfo's 
  +//outputLineIncrement, if possible
  +int i=0;
  +while (i  lineData.size()-1) {
  +LineInfo li = (LineInfo)lineData.get(i);
  +LineInfo liNext = (LineInfo)lineData.get(i+1);
  +if (liNext.inputStartLine == li.inputStartLine
  +  liNext.inputLineCount==1
  +   li.inputLineCount==1) {
  +li.setOutputLineIncrement(liNext.outputStartLine - 
li.outputStartLine + liNext.outputLineIncrement);
  +lineData.remove(i+1);
  +} else {
  +i++; 
  +}
  +}
  +
  +//Incorporate each LineInfo into the previous LineInfo's
  +//inputLineCount, if possible
  +i=0;
  +while (i  lineData.size()-1) {
  +LineInfo li = (LineInfo)lineData.get(i);
  +LineInfo liNext = (LineInfo)lineData.get(i+1);
  +if (liNext.inputStartLine == li.inputStartLine + li.inputLineCount
  +  liNext.outputLineIncrement == li.outputLineIncrement
  +   liNext.outputStartLine == li.outputStartLine + 
li.inputLineCount*li.outputLineIncrement) {
  +  li.setInputLineCount(li.inputLineCount + liNext.inputLineCount);
  +  lineData.remove(i+1);
  + } else {
  + i++;
  + }
  +}
  +}
  +
  +/**
* Adds complete information about a simple line mapping.  Specify
* all the fields in this method; the back-end machinery takes care
* of printing only those that are 

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

2003-08-03 Thread remm
remm2003/08/03 02:07:47

  Modified:jasper2/src/share/org/apache/jasper/compiler Generator.java
  Log:
  - Fix incorrect indentation of generated code, submitted by Eric Carmichael.
  
  Revision  ChangesPath
  1.193 +6 -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.192
  retrieving revision 1.193
  diff -u -r1.192 -r1.193
  --- Generator.java22 Jul 2003 21:04:46 -  1.192
  +++ Generator.java3 Aug 2003 09:07:47 -   1.193
  @@ -1732,7 +1732,9 @@
// Generate an out.write() when see a '\n' in template
sb.append(\););
out.println(sb.toString());
  - out.printin();
  +if (i  text.length()-1) {
  +out.printin();
  +}
sb.setLength(initLength);
count = CHUNKSIZE;
}
  
  
  

-
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-07-20 Thread billbarker
billbarker2003/07/20 22:34:56

  Modified:jasper2/src/share/org/apache/jasper/compiler Generator.java
  Log:
  Fix comment generation.
  
  Fix for bug #21753
  Submitted by: Eric Carmichael [EMAIL PROTECTED]
  
  Revision  ChangesPath
  1.190 +7 -9  
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.189
  retrieving revision 1.190
  diff -u -r1.189 -r1.190
  --- Generator.java23 Jun 2003 23:20:44 -  1.189
  +++ Generator.java21 Jul 2003 05:34:55 -  1.190
  @@ -1888,9 +1888,8 @@
Class tagHandlerClass = handlerInfo.getTagHandlerClass();
   
n.setBeginJavaLine(out.getJavaLine());
  - out.printin(/*   );
  - out.print(n.getQName());
  - out.println(  */);
  + out.printin(//  );
  + out.println(n.getQName());
   
// Declare AT_BEGIN scripting variables
declareScriptingVars(n, VariableInfo.AT_BEGIN);
  @@ -2094,9 +2093,8 @@
Class tagHandlerClass = handlerInfo.getTagHandlerClass();
   
n.setBeginJavaLine(out.getJavaLine());
  - out.printin(/*   );
  - out.print(n.getQName());
  - out.println(  */);
  + out.printin(//  );
  + out.println(n.getQName());
   
   // Declare AT_BEGIN scripting variables
declareScriptingVars(n, VariableInfo.AT_BEGIN);
  
  
  

-
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-06-23 Thread kinman
kinman  2003/06/23 16:20:45

  Modified:jasper2/src/share/org/apache/jasper/compiler Generator.java
  Log:
  - Allow the value attrbute of jsp:param action be non String types.
  
  Revision  ChangesPath
  1.189 +14 -11
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.188
  retrieving revision 1.189
  diff -u -r1.188 -r1.189
  --- Generator.java24 May 2003 00:53:09 -  1.188
  +++ Generator.java23 Jun 2003 23:20:44 -  1.189
  @@ -709,16 +709,19 @@
if (!attr.isNamedAttribute()  (v == null))
return ;
   
  -if (attr.isExpression() || attr.isELInterpreterInput()) {
  - if (attr.isELInterpreterInput()) {
  - boolean replaceESC = v.indexOf(Constants.ESC)  0;
  - v = JspUtil.interpreterCall(this.isTagFile,
  +if (attr.isExpression()){
  + if (encode) {
  + return 
org.apache.jasper.runtime.JspRuntimeLibrary.URLEncode(String.valueOf( + v + ), 
request.getCharacterEncoding());
  + }
  + return v;
  + } else if (attr.isELInterpreterInput()) {
  + boolean replaceESC = v.indexOf(Constants.ESC)  0;
  + v = JspUtil.interpreterCall(this.isTagFile,
v, expectedType,
attr.getEL().getMapName(), false );
  - // XXX ESC replacement hack
  - if (replaceESC) {
  - v = ( + v + ).replace( + Constants.ESCStr + , '$');
  - }
  + // XXX ESC replacement hack
  + if (replaceESC) {
  + v = ( + v + ).replace( + Constants.ESCStr + , '$');
}
if (encode) {
return org.apache.jasper.runtime.JspRuntimeLibrary.URLEncode( + 
v + , request.getCharacterEncoding());
  
  
  

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

2003-03-31 Thread luehe
luehe   2003/03/31 13:14:05

  Modified:jasper2/src/share/org/apache/jasper/compiler Generator.java
Node.java
  Log:
  Fixed wrong signature of setJspContext for SimpleTag handlers that are not supported 
by tag files
  
  Revision  ChangesPath
  1.179 +11 -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.178
  retrieving revision 1.179
  diff -u -r1.178 -r1.179
  --- Generator.java31 Mar 2003 17:54:30 -  1.178
  +++ Generator.java31 Mar 2003 21:14:04 -  1.179
  @@ -2436,8 +2436,8 @@
   
String nameFrom = tagVars[i].getNameFromAttribute();
if (nameFrom != null) {
  - String aliaseName = n.getAttributeValue(nameFrom);
  - if (aliaseName == null) continue;
  + String aliasedName = n.getAttributeValue(nameFrom);
  + if (aliasedName == null) continue;
   
if ( ! aliasSeen ) {
out.printin(java.util.HashMap );
  @@ -2450,7 +2450,7 @@
out.print(.put();
out.print(quote(tagVars[i].getNameGiven()));
out.print(, );
  - out.print(quote(aliaseName));
  + out.print(quote(aliasedName));
out.println(););
}
}
  @@ -2466,7 +2466,10 @@
// Set context
if (simpleTag) {
// Generate alias map 
  - String aliasMapVar= generateAliasMap(n, tagHandlerVar);
  + String aliasMapVar = null;
  + if (n.isTagFile()) {
  + aliasMapVar = generateAliasMap(n, tagHandlerVar);
  + }
out.printin(tagHandlerVar);
if (aliasMapVar == null) {
out.println(.setJspContext(pageContext););
  @@ -3135,7 +3138,7 @@
boolean atBeginSeen = false;
boolean atEndSeen = false;
   
  - // Determine if there is any aliases
  + // Determine if there are any aliases
boolean aliasSeen = false;
TagVariableInfo[] tagVars = tagInfo.getTagVariableInfos();
for (int i=0; itagVars.length; i++) {
  
  
  
  1.70  +11 -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.69
  retrieving revision 1.70
  diff -u -r1.69 -r1.70
  --- Node.java 28 Mar 2003 02:13:02 -  1.69
  +++ Node.java 31 Mar 2003 21:14:05 -  1.70
  @@ -1368,6 +1368,14 @@
return tagFileInfo;
}
   
  + /*
  +  * @return true if this custom action is supported by a tag file,
  +  * false otherwise
  +  */
  + public boolean isTagFile() {
  + return tagFileInfo != null;
  + }
  +
public Class getTagHandlerClass() {
return tagHandlerClass;
}
  
  
  

-
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-02-28 Thread kinman
kinman  2003/02/28 14:12:39

  Modified:jasper2/src/share/org/apache/jasper/compiler Generator.java
  Log:
  - Fix a typo for tag plugins.
  
  Revision  ChangesPath
  1.171 +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.170
  retrieving revision 1.171
  diff -u -r1.170 -r1.171
  --- Generator.java27 Feb 2003 20:10:13 -  1.170
  +++ Generator.java28 Feb 2003 22:12:38 -  1.171
  @@ -1906,7 +1906,7 @@
Node.CustomTag tag = n.getTag();
   Node.JspAttribute[] attrs = tag.getJspAttributes();
   for (int i=0; iattrs.length; i++) {
  - if (attrs[i].getName().equals(n.getQName())) {
  + if (attrs[i].getName().equals(n.getName())) {
out.print(evaluateAttribute(getTagHandlerInfo(tag),
attrs[i], tag, null));
break;
  
  
  

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



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

2003-02-27 Thread luehe
luehe   2003/02/27 12:10:13

  Modified:jasper2/src/share/org/apache/jasper/compiler Generator.java
  Log:
  Fixed 17492: If the omit-xml-declaration attribute of jsp:output is
  'true' or 'yes' in the context of a JSP document, the xml declaration
  is still generated.
  
  Revision  ChangesPath
  1.170 +8 -7  
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.169
  retrieving revision 1.170
  diff -u -r1.169 -r1.170
  --- Generator.java26 Feb 2003 22:58:15 -  1.169
  +++ Generator.java27 Feb 2003 20:10:13 -  1.170
  @@ -601,10 +601,11 @@
* - JSP document without a jsp:root
*/
   private void generateXmlDeclaration(Node.Nodes page) {
  - if (pageInfo.getOmitXmlDecl() != null
  -  !JspUtil.booleanValue(pageInfo.getOmitXmlDecl())
  - || (page.getRoot().isXmlSyntax()  !pageInfo.hasJspRoot()
  -  !ctxt.isTagFile())) {
  +
  + String omitXmlDecl = pageInfo.getOmitXmlDecl();
  + if ((omitXmlDecl != null  !JspUtil.booleanValue(omitXmlDecl))
  + || (omitXmlDecl == null  page.getRoot().isXmlSyntax()
  +  !pageInfo.hasJspRoot()  !ctxt.isTagFile())) {
String cType = pageInfo.getContentType();
String charSet = cType.substring(cType.indexOf(charset=)+8);
out.printil(out.write(\?xml version=\\\1.0\\\ encoding=\\\ +
  
  
  

-
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-02-25 Thread luehe
luehe   2003/02/25 16:54:02

  Modified:jasper2/src/share/org/apache/jasper/compiler Generator.java
  Log:
  Fixed bracket indentation
  
  Revision  ChangesPath
  1.167 +6 -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.166
  retrieving revision 1.167
  diff -u -r1.166 -r1.167
  --- Generator.java26 Feb 2003 00:11:38 -  1.166
  +++ Generator.java26 Feb 2003 00:54:02 -  1.167
  @@ -645,10 +645,10 @@
}
out.println(););
}
  + out.popIndent();
  + out.printil(});
  + out.println();
}
  - out.popIndent();
  - out.printil(});
  - out.println();
   }
   
   /**
  
  
  

-
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-02-25 Thread luehe
luehe   2003/02/25 17:11:15

  Modified:jasper2/src/share/org/apache/jasper/compiler Generator.java
  Log:
  Fixed 17052: jsp:element name attribute clobbered by nested jsp:attribute
  (cont.)
  
  Revision  ChangesPath
  1.168 +9 -9  
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.167
  retrieving revision 1.168
  diff -u -r1.167 -r1.168
  --- Generator.java26 Feb 2003 00:54:02 -  1.167
  +++ Generator.java26 Feb 2003 01:11:14 -  1.168
  @@ -1694,12 +1694,12 @@
map.put(attrs[i].getName(), s);
}
   
  - // Write begin tag
  + // Write begin tag, using XML-style 'name' attribute as the
  + // element name
  + String elemName = attributeValue(n.getNameAttribute(), false,
  +  String.class, null);
out.printin(out.write(\\);
  -
  - // Write XML-style 'name' attribute
  - out.print( +  + attributeValue(n.getNameAttribute(), false,
  -  String.class, null));
  + out.print( +  + elemName);
   
// Write remaining attributes
Enumeration enum = map.keys();
  @@ -1729,7 +1729,7 @@
   
// Write end tag
out.printin(out.write(\/\);
  - out.print((String) map.get(name));
  + out.print( +  + elemName);
out.println( + \\););
} else {
out.println( + \/\););
  
  
  

-
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-02-24 Thread luehe
luehe   2003/02/24 08:38:41

  Modified:jasper2/src/share/org/apache/jasper/compiler Tag:
tomcat_4_branch Generator.java
  Log:
  Fixed 17049: Invalid code generated when nesting tags
  
  Revision  ChangesPath
  No   revision
  
  
  No   revision
  
  
  1.35.2.20 +15 -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.19
  retrieving revision 1.35.2.20
  diff -u -r1.35.2.19 -r1.35.2.20
  --- Generator.java13 Feb 2003 18:15:45 -  1.35.2.19
  +++ Generator.java24 Feb 2003 16:38:41 -  1.35.2.20
  @@ -1123,7 +1123,12 @@
out.print(, );
}
   //   out.println(pageContext, _jspxState));
  - out.println(pageContext)));
  + out.print(pageContext);
  + if (pushBodyCountVar != null) {
  + out.print(, );
  + out.print(pushBodyCountVar);
  + }
  + out.println()));
out.pushIndent();
out.printil((methodNesting  0)? return true;: return;);
out.popIndent();
  @@ -1147,7 +1152,12 @@
out.print(, );
}
   //   out.println(javax.servlet.jsp.PageContext pageContext, JspxState 
_jspxState));
  - out.println(javax.servlet.jsp.PageContext pageContext));
  + out.print(javax.servlet.jsp.PageContext pageContext);
  + if (pushBodyCountVar != null) {
  + out.print(, int );
  + out.print(pushBodyCountVar);
  + }
  + out.println());
out.printil(throws Throwable {);
out.pushIndent();
   
  
  
  

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

2003-02-13 Thread luehe
luehe   2003/02/13 10:15:46

  Modified:jasper2/src/share/org/apache/jasper/compiler Tag:
tomcat_4_branch Generator.java
JspDocumentParser.java Node.java Parser.java
  Log:
  Added support for jsp:fallback to XML syntax
  
  Revision  ChangesPath
  No   revision
  
  
  No   revision
  
  
  1.35.2.19 +5 -11 
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.18
  retrieving revision 1.35.2.19
  diff -u -r1.35.2.18 -r1.35.2.19
  --- Generator.java10 Feb 2003 17:06:11 -  1.35.2.18
  +++ Generator.java13 Feb 2003 18:15:45 -  1.35.2.19
  @@ -1069,14 +1069,8 @@
 * Fallback
 */
if (n.getBody() != null) {
  - n.getBody().visit(new Node.Visitor() {
  - public void visit(Node.FallBackAction n) {
  - n.setBeginJavaLine(out.getJavaLine());
  - out.printil(out.println( +
  - quote(new String(n.getText())) + ););
  - n.setEndJavaLine(out.getJavaLine());
  - }
  - });
  + visitBody(n);
  + out.printil(out.write(\\\n\););
}
   
out.printil(out.println( + quote(/NOEMBED/EMBED) + ););
  
  
  
  1.4.2.3   +5 -3  
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.4.2.2
  retrieving revision 1.4.2.3
  diff -u -r1.4.2.2 -r1.4.2.3
  --- JspDocumentParser.java17 Aug 2002 00:14:23 -  1.4.2.2
  +++ JspDocumentParser.java13 Feb 2003 18:15:45 -  1.4.2.3
  @@ -233,6 +233,8 @@
node = new Node.PlugIn(attrsCopy, start, current);
} else if (qName.equals(JSP_TEXT_TAG)) {
node = new Node.JspText(start, current);
  + } else if (qName.equals(JSP_FALLBACK_TAG)) {
  + node = new Node.FallBackAction(start, current);
} else {
node = getCustomTag(qName, attrsCopy, start, current);
if (node == null) {
  
  
  
  1.15.2.5  +5 -5  
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.15.2.4
  retrieving revision 1.15.2.5
  diff -u -r1.15.2.4 -r1.15.2.5
  --- Node.java 6 Nov 2002 23:43:51 -   1.15.2.4
  +++ Node.java 13 Feb 2003 18:15:45 -  1.15.2.5
  @@ -482,8 +482,8 @@
*/
   public static class FallBackAction extends Node {
   
  - public FallBackAction(Mark start, char[] text, Node parent) {
  - super(text, start, parent);
  + public FallBackAction(Mark start, Node parent) {
  + super(start, parent);
}
   
public void accept(Visitor v) throws JasperException {
  
  
  
  1.7.2.4   +5 -10 
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.7.2.3
  retrieving revision 1.7.2.4
  diff -u -r1.7.2.3 -r1.7.2.4
  --- Parser.java   8 Oct 2002 23:42:06 -   1.7.2.3
  +++ Parser.java   13 Feb 2003 18:15:45 -  1.7.2.4
  @@ -610,13 +610,8 @@
err.jspError(reader.mark(), jsp.error.fallback.notclosed);
}
   
  - Mark bodyStart = reader.mark();
  -Mark bodyEnd = reader.skipUntilETag(jsp:fallback);
  -if (bodyEnd == null) {
  -err.jspError(start, jsp.error.unterminated, jsp:fallback);
  - }
  - char[] text = reader.getText(bodyStart, bodyEnd);
  -new Node.FallBackAction(start, text, parent);
  +Node.FallBackAction fallback = new Node.FallBackAction(start, parent);
  + parseBodyText(fallback, jsp:fallback);
   }
   
   /*
  
  
  

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

2003-02-10 Thread luehe
luehe   2003/02/10 09:06:15

  Modified:jasper2/src/share/org/apache/jasper/compiler Tag:
tomcat_4_branch Generator.java Validator.java
  Log:
  Fixed 16200 (isThreadSafe does not work !!)
  
  Revision  ChangesPath
  No   revision
  
  
  No   revision
  
  
  1.35.2.18 +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.35.2.17
  retrieving revision 1.35.2.18
  diff -u -r1.35.2.17 -r1.35.2.18
  --- Generator.java17 Jan 2003 01:21:06 -  1.35.2.17
  +++ Generator.java10 Feb 2003 17:06:11 -  1.35.2.18
  @@ -360,7 +360,7 @@
out.print  ( extends );
out.print  (pageInfo.getExtends());
if (!pageInfo.isThreadSafe()) {
  - out.print(implements SingleThreadModel);
  + out.print( implements SingleThreadModel);
}
out.println( {);
out.pushIndent();
  
  
  
  1.11.2.2  +4 -4  
jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/compiler/Validator.java
  
  Index: Validator.java
  ===
  RCS file: 
/home/cvs/jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/compiler/Validator.java,v
  retrieving revision 1.11.2.1
  retrieving revision 1.11.2.2
  diff -u -r1.11.2.1 -r1.11.2.2
  --- Validator.java5 Aug 2002 23:50:27 -   1.11.2.1
  +++ Validator.java10 Feb 2003 17:06:11 -  1.11.2.2
  @@ -200,7 +200,7 @@
pageInfo.setAutoFlush(false);
else
err.jspError(n, jsp.error.autoFlush.invalid);
  - } else if (isthreadSafe.equals(attr)) {
  + } else if (isThreadSafe.equals(attr)) {
if (isThreadSafeSeen)
err.jspError(n, jsp.error.page.multiple.threadsafe);
isThreadSafeSeen = true;
  
  
  

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




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

2003-01-30 Thread luehe
luehe   2003/01/30 12:30:52

  Modified:jasper2/src/share/org/apache/jasper/compiler Generator.java
  Log:
  Fixed out-of-scope problem with pushBody count variables when custom
  tag invocations are separated out into their own methods
  
  Revision  ChangesPath
  1.157 +15 -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.156
  retrieving revision 1.157
  diff -u -r1.156 -r1.157
  --- Generator.java28 Jan 2003 22:06:27 -  1.156
  +++ Generator.java30 Jan 2003 20:30:51 -  1.157
  @@ -1524,7 +1524,12 @@
out.print(, );
}
   //   out.println(pageContext, _jspxState));
  - out.println(pageContext)));
  + out.print(pageContext);
  + if (pushBodyCountVar != null) {
  + out.print(, );
  + out.print(pushBodyCountVar);
  + }
  + out.println()));
out.pushIndent();
out.printil((methodNesting  0)? return true;: return;);
out.popIndent();
  @@ -1548,7 +1553,12 @@
out.print(, );
}
   //   out.println(PageContext pageContext, JspxState _jspxState));
  - out.println(PageContext pageContext));
  + out.print(PageContext pageContext);
  + if (pushBodyCountVar != null) {
  + out.print(, int );
  + out.print(pushBodyCountVar);
  + }
  + out.println());
out.printil(throws Throwable {);
out.pushIndent();
   
  
  
  

-
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-01-22 Thread costin
costin  2003/01/22 11:55:47

  Modified:jasper2/src/share/org/apache/jasper/compiler Generator.java
  Log:
  Use the factory method of TagHandlerPool
  
  Revision  ChangesPath
  1.152 +5 -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.151
  retrieving revision 1.152
  diff -u -r1.151 -r1.152
  --- Generator.java21 Jan 2003 23:45:18 -  1.151
  +++ Generator.java22 Jan 2003 19:55:47 -  1.152
  @@ -660,8 +660,8 @@
out.pushIndent();
for (int i=0; itagHandlerPoolNames.size(); i++) {
out.printin((String) tagHandlerPoolNames.elementAt(i));
  - out.print( = new org.apache.jasper.runtime.TagHandlerPool();
  -out.print(ctxt.getOptions().getTagPoolSize());
  + out.print( = 
org.apache.jasper.runtime.TagHandlerPool.getTagHandlerPool();
  +out.print(this);
   out.println(););
}
out.popIndent();
  
  
  

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




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

2003-01-22 Thread costin
costin  2003/01/22 12:54:54

  Modified:jasper2/src/share/org/apache/jasper/compiler Generator.java
  Log:
  Move tag pool initialization to _jspInit - to have access to
  config info.
  
  Revision  ChangesPath
  1.153 +16 -11
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.152
  retrieving revision 1.153
  diff -u -r1.152 -r1.153
  --- Generator.java22 Jan 2003 19:55:47 -  1.152
  +++ Generator.java22 Jan 2003 20:54:54 -  1.153
  @@ -657,16 +657,21 @@
*/
   private void generateConstructor(String className) {
out.printil(public  + className + () {);
  - out.pushIndent();
  - for (int i=0; itagHandlerPoolNames.size(); i++) {
  - out.printin((String) tagHandlerPoolNames.elementAt(i));
  - out.print( = 
org.apache.jasper.runtime.TagHandlerPool.getTagHandlerPool();
  -out.print(this);
  -out.println(););
  - }
  - out.popIndent();
out.printil(});
out.println();
  +
  +out.printil(public void _jspInit() {);
  +out.pushIndent();
  +for (int i=0; itagHandlerPoolNames.size(); i++) {
  +out.printin((String) tagHandlerPoolNames.elementAt(i));
  +out.print( = 
org.apache.jasper.runtime.TagHandlerPool.getTagHandlerPool();
  +out.print(this);
  +out.println(););
  +}
  +out.popIndent();
  +out.printil(});
  +out.println();
  +
   }
   
   /**
  
  
  

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




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

2003-01-21 Thread luehe
luehe   2003/01/21 15:45:19

  Modified:jasper2/src/share/org/apache/jasper/compiler Generator.java
  Log:
  Modified code generated for jsp:plugin to be well-formed.
  
  Example:
  
  Previous format of generated code:
  
COMMENT
EMBED ...
NOEMBED
  
/COMMENT
  
  pUnable to start plugin./p
  
/NOEMBED/EMBED
  
  New format of generated code:
  
COMMENT
EMBED ... /
NOEMBED
  
  pUnable to start plugin./p
  
/NOEMBED
/COMMENT
  
  Revision  ChangesPath
  1.151 +9 -7  
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.150
  retrieving revision 1.151
  diff -u -r1.150 -r1.151
  --- Generator.java17 Jan 2003 01:21:16 -  1.150
  +++ Generator.java21 Jan 2003 23:45:18 -  1.151
  @@ -1447,13 +1447,11 @@
if (n.getBody() != null)
n.getBody().visit(new ParamVisitor(false)); 
   
  - out.printil(out.write( + quote() + ););
  + out.printil(out.write( + quote(/) + ););
out.printil(out.write(\\\n\););
   
out.printil(out.write( + quote(NOEMBED) + ););
out.printil(out.write(\\\n\););
  - out.printil(out.write( + quote(/COMMENT) + ););
  - out.printil(out.write(\\\n\););
   
/*
 * Fallback
  @@ -1463,8 +1461,12 @@
out.printil(out.write(\\\n\););
}
   
  - out.printil(out.write( + quote(/NOEMBED/EMBED) + ););
  + out.printil(out.write( + quote(/NOEMBED) + ););
  + out.printil(out.write(\\\n\););
  +
  + out.printil(out.write( + quote(/COMMENT) + ););
out.printil(out.write(\\\n\););
  +
out.printil(out.write( + quote(/OBJECT) + ););
out.printil(out.write(\\\n\););
   
  
  
  

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




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

2003-01-17 Thread luehe
luehe   2003/01/16 17:21:16

  Modified:jasper2/src/share/org/apache/jasper/compiler Generator.java
  Log:
  Fixed 16181: JspWriter not restored properly when exception thrown in a tag's body 
content
  
  Revision  ChangesPath
  1.150 +12 -12
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.149
  retrieving revision 1.150
  diff -u -r1.149 -r1.150
  --- Generator.java17 Jan 2003 00:51:34 -  1.149
  +++ Generator.java17 Jan 2003 01:21:16 -  1.150
  @@ -706,7 +706,7 @@
   
private Hashtable tagVarNumbers;
private String parent;
  - private String pushBodyCount;
  + private String pushBodyCountVar;
private String simpleTagHandlerVar;
private boolean isSimpleTagHandler;
private boolean isFragment;
  @@ -1559,10 +1559,10 @@
// visit body
String tmpParent = parent;
parent = tagHandlerVar;
  - String tmpPushBodyCount = null;
  + String tmpPushBodyCountVar = null;
if (n.implementsTryCatchFinally()) {
  - tmpPushBodyCount = pushBodyCount;
  - pushBodyCount = tagPushBodyCountVar;
  + tmpPushBodyCountVar = pushBodyCountVar;
  + pushBodyCountVar = tagPushBodyCountVar;
}
boolean tmpIsSimpleTagHandler = isSimpleTagHandler;
isSimpleTagHandler = false;
  @@ -1571,7 +1571,7 @@
   
parent = tmpParent;
if (n.implementsTryCatchFinally()) {
  - pushBodyCount = tmpPushBodyCount;
  + pushBodyCountVar = tmpPushBodyCountVar;
}
isSimpleTagHandler = tmpIsSimpleTagHandler;
   
  @@ -1998,8 +1998,8 @@
if (n.implementsTryCatchFinally()) {
out.printin(tagPushBodyCountVar);
out.println(++;);
  - } else if (pushBodyCount != null) {
  - out.printin(pushBodyCount);
  + } else if (pushBodyCountVar != null) {
  + out.printin(pushBodyCountVar);
out.println(++;);
}
out.printin(tagHandlerVar);
  @@ -2061,8 +2061,8 @@
if (n.implementsTryCatchFinally()) {
out.printin(tagPushBodyCountVar);
out.println(--;);
  - } else if (pushBodyCount != null) {
  - out.printin(pushBodyCount);
  + } else if (pushBodyCountVar != null) {
  + out.printin(pushBodyCountVar);
out.println(--;);
}
out.popIndent();
  
  
  

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




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

2003-01-17 Thread luehe
luehe   2003/01/16 17:21:06

  Modified:jasper2/src/share/org/apache/jasper/compiler Tag:
tomcat_4_branch Generator.java
  Log:
  Fixed 16181: JspWriter not restored properly when exception thrown in a tag's body 
content
  
  Revision  ChangesPath
  No   revision
  
  
  No   revision
  
  
  1.35.2.17 +12 -12
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.16
  retrieving revision 1.35.2.17
  diff -u -r1.35.2.16 -r1.35.2.17
  --- Generator.java17 Jan 2003 00:51:23 -  1.35.2.16
  +++ Generator.java17 Jan 2003 01:21:06 -  1.35.2.17
  @@ -545,7 +545,7 @@
   
private Hashtable tagVarNumbers;
private String parent;
  - private String pushBodyCount;
  + private String pushBodyCountVar;
   
private ServletWriter out;
private MethodsBuffer methodsBuffer;
  @@ -1177,17 +1177,17 @@
   
String tmpParent = parent;
parent = tagHandlerVar;
  - String tmpPushBodyCount = null;
  + String tmpPushBodyCountVar = null;
if (n.implementsTryCatchFinally()) {
  - tmpPushBodyCount = pushBodyCount;
  - pushBodyCount = tagPushBodyCountVar;
  + tmpPushBodyCountVar = pushBodyCountVar;
  + pushBodyCountVar = tagPushBodyCountVar;
}
   
visitBody(n);
   
parent = tmpParent;
if (n.implementsTryCatchFinally()) {
  - pushBodyCount = tmpPushBodyCount;
  + pushBodyCountVar = tmpPushBodyCountVar;
}
   
generateCustomEnd(n, tagHandlerVar, tagEvalVar,
  @@ -1390,8 +1390,8 @@
if (n.implementsTryCatchFinally()) {
out.printin(tagPushBodyCountVar);
out.println(++;);
  - } else if (pushBodyCount != null) {
  - out.printin(pushBodyCount);
  + } else if (pushBodyCountVar != null) {
  + out.printin(pushBodyCountVar);
out.println(++;);
}
out.printil(out = _bc;);
  @@ -1458,8 +1458,8 @@
if (n.implementsTryCatchFinally()) {
out.printin(tagPushBodyCountVar);
out.println(--;);
  - } else if (pushBodyCount != null) {
  - out.printin(pushBodyCount);
  + } else if (pushBodyCountVar != null) {
  + out.printin(pushBodyCountVar);
out.println(--;);
}
out.popIndent();
  
  
  

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




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

2003-01-17 Thread luehe
luehe   2003/01/16 16:51:23

  Modified:jasper2/src/share/org/apache/jasper/compiler Tag:
tomcat_4_branch Generator.java
  Log:
  Fixed 16181: JspWriter not restored properly when exception thrown in a tag's body 
content
  
  Revision  ChangesPath
  No   revision
  
  
  No   revision
  
  
  1.35.2.16 +49 -7 
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.15
  retrieving revision 1.35.2.16
  diff -u -r1.35.2.15 -r1.35.2.16
  --- Generator.java15 Jan 2003 00:20:46 -  1.35.2.15
  +++ Generator.java17 Jan 2003 00:51:23 -  1.35.2.16
  @@ -545,6 +545,7 @@
   
private Hashtable tagVarNumbers;
private String parent;
  + private String pushBodyCount;
   
private ServletWriter out;
private MethodsBuffer methodsBuffer;
  @@ -1106,6 +1107,7 @@
  n.getShortName());
String tagEvalVar = _jspx_eval_ + baseVar;
String tagHandlerVar = _jspx_th_ + baseVar;
  + String tagPushBodyCountVar = _jspx_push_body_count_ + baseVar;
   
// If the tag contains no scripting element, generate its codes
// to a method.
  @@ -1170,14 +1172,26 @@
}
   
// Generate code for start tag, body, and end tag
  - generateCustomStart(n, handlerInfo, tagHandlerVar, tagEvalVar);
  + generateCustomStart(n, handlerInfo, tagHandlerVar, tagEvalVar,
  + tagPushBodyCountVar);
   
String tmpParent = parent;
parent = tagHandlerVar;
  + String tmpPushBodyCount = null;
  + if (n.implementsTryCatchFinally()) {
  + tmpPushBodyCount = pushBodyCount;
  + pushBodyCount = tagPushBodyCountVar;
  + }
  +
visitBody(n);
   
parent = tmpParent;
  - generateCustomEnd(n, tagHandlerVar, tagEvalVar);
  + if (n.implementsTryCatchFinally()) {
  + pushBodyCount = tmpPushBodyCount;
  + }
  +
  + generateCustomEnd(n, tagHandlerVar, tagEvalVar,
  +   tagPushBodyCountVar);
   
if (n.isScriptless()  !n.hasScriptingVars()) {
// Generate end of method
  @@ -1302,7 +1316,8 @@
private void generateCustomStart(Node.CustomTag n,
 TagHandlerInfo handlerInfo,
 String tagHandlerVar,
  -  String tagEvalVar)
  +  String tagEvalVar,
  +  String tagPushBodyCountVar)
throws JasperException {
   
Class tagHandlerClass = handlerInfo.getTagHandlerClass();
  @@ -1337,9 +1352,13 @@
generateSetters(n, tagHandlerVar, handlerInfo);

   if (n.implementsTryCatchFinally()) {
  + out.printin(int );
  + out.print(tagPushBodyCountVar);
  + out.println( = 0;);
   out.printil(try {);
   out.pushIndent();
   }
  +
out.printin(int );
out.print(tagEvalVar);
out.print( = );
  @@ -1368,6 +1387,13 @@
// Assume EVAL_BODY_BUFFERED
out.pushIndent();
out.printil(javax.servlet.jsp.tagext.BodyContent _bc = 
pageContext.pushBody(););
  + if (n.implementsTryCatchFinally()) {
  + out.printin(tagPushBodyCountVar);
  + out.println(++;);
  + } else if (pushBodyCount != null) {
  + out.printin(pushBodyCount);
  + out.println(++;);
  + }
out.printil(out = _bc;);
   
out.printin(tagHandlerVar);
  @@ -1396,7 +1422,8 @@

private void generateCustomEnd(Node.CustomTag n,
   String tagHandlerVar,
  -String tagEvalVar) {
  +String tagEvalVar,
  +String tagPushBodyCountVar) {
   
VariableInfo[] varInfos = n.getVariableInfos();
TagVariableInfo[] tagVarInfos = n.getTagVariableInfos();
  @@ -1428,6 +1455,13 @@
out.println( != javax.servlet.jsp.tagext.Tag.EVAL_BODY_INCLUDE));
out.pushIndent();
   out.printil(out = pageContext.popBody(););
  + if (n.implementsTryCatchFinally()) {
  + out.printin(tagPushBodyCountVar);
  

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

2003-01-17 Thread luehe
luehe   2003/01/16 16:51:35

  Modified:jasper2/src/share/org/apache/jasper/compiler Generator.java
  Log:
  Fixed 16181: JspWriter not restored properly when exception thrown in a tag's body 
content
  
  Revision  ChangesPath
  1.149 +48 -7 
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.148
  retrieving revision 1.149
  diff -u -r1.148 -r1.149
  --- Generator.java15 Jan 2003 22:46:29 -  1.148
  +++ Generator.java17 Jan 2003 00:51:34 -  1.149
  @@ -706,6 +706,7 @@
   
private Hashtable tagVarNumbers;
private String parent;
  + private String pushBodyCount;
private String simpleTagHandlerVar;
private boolean isSimpleTagHandler;
private boolean isFragment;
  @@ -1489,6 +1490,7 @@
  n.getShortName());
String tagEvalVar = _jspx_eval_ + baseVar;
String tagHandlerVar = _jspx_th_ + baseVar;
  + String tagPushBodyCountVar = _jspx_push_body_count_ + baseVar;
   
// If the tag contains no scripting element, generate its codes
// to a method.
  @@ -1551,18 +1553,30 @@
 * Classic tag handler: Generate code for start element, body,
 * and end element
 */
  - generateCustomStart(n, handlerInfo, tagHandlerVar, tagEvalVar);
  + generateCustomStart(n, handlerInfo, tagHandlerVar, tagEvalVar,
  + tagPushBodyCountVar);
   
// visit body
String tmpParent = parent;
parent = tagHandlerVar;
  + String tmpPushBodyCount = null;
  + if (n.implementsTryCatchFinally()) {
  + tmpPushBodyCount = pushBodyCount;
  + pushBodyCount = tagPushBodyCountVar;
  + }
boolean tmpIsSimpleTagHandler = isSimpleTagHandler;
isSimpleTagHandler = false;
  +
visitBody(n);
  +
parent = tmpParent;
  + if (n.implementsTryCatchFinally()) {
  + pushBodyCount = tmpPushBodyCount;
  + }
isSimpleTagHandler = tmpIsSimpleTagHandler;
   
  - generateCustomEnd(n, tagHandlerVar, tagEvalVar);
  + generateCustomEnd(n, tagHandlerVar, tagEvalVar,
  +   tagPushBodyCountVar);
}
   
if (ci.isScriptless()  !ci.hasScriptingVars()) {
  @@ -1911,7 +1925,8 @@
private void generateCustomStart(Node.CustomTag n,
 TagHandlerInfo handlerInfo,
 String tagHandlerVar,
  -  String tagEvalVar)
  +  String tagEvalVar,
  +  String tagPushBodyCountVar)
throws JasperException {
   
Class tagHandlerClass = handlerInfo.getTagHandlerClass();
  @@ -1946,6 +1961,9 @@
generateSetters(n, tagHandlerVar, handlerInfo, false);

   if (n.implementsTryCatchFinally()) {
  + out.printin(int );
  + out.print(tagPushBodyCountVar);
  + out.println( = 0;);
   out.printil(try {);
   out.pushIndent();
   }
  @@ -1977,6 +1995,13 @@
// Assume EVAL_BODY_BUFFERED
out.pushIndent();
out.printil(out = pageContext.pushBody(););
  + if (n.implementsTryCatchFinally()) {
  + out.printin(tagPushBodyCountVar);
  + out.println(++;);
  + } else if (pushBodyCount != null) {
  + out.printin(pushBodyCount);
  + out.println(++;);
  + }
out.printin(tagHandlerVar);

out.println(.setBodyContent((javax.servlet.jsp.tagext.BodyContent) out););
out.printin(tagHandlerVar);
  @@ -2003,7 +2028,8 @@

private void generateCustomEnd(Node.CustomTag n,
   String tagHandlerVar,
  -String tagEvalVar) {
  +String tagEvalVar,
  +String tagPushBodyCountVar) {
   
if (!n.hasEmptyBody()) {
if (n.implementsIterationTag()) {
  @@ -2032,6 +2058,13 @@
out.println( != javax.servlet.jsp.tagext.Tag.EVAL_BODY_INCLUDE));
out.pushIndent();
   out.printil(out = 

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

2003-01-15 Thread luehe
luehe   2003/01/15 14:46:29

  Modified:jasper2/src/share/org/apache/jasper/compiler Generator.java
  Log:
  Fixed 15961 (getBodyContent() is not returning null when the action
  has only jsp:attribute actions within the body) for simple tag handlers
  
  Revision  ChangesPath
  1.148 +12 -10
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.147
  retrieving revision 1.148
  diff -u -r1.147 -r1.148
  --- Generator.java11 Jan 2003 00:52:14 -  1.147
  +++ Generator.java15 Jan 2003 22:46:29 -  1.148
  @@ -1756,13 +1756,15 @@
}
   
public void visit(Node.JspBody n) throws JasperException {
  - if (isSimpleTagHandler) {
  - out.printin(simpleTagHandlerVar);
  - out.print(.setJspBody();
  - generateJspFragment(n, simpleTagHandlerVar);
  - out.println(););
  - } else {
  - visitBody(n);
  + if (n.getBody() != null) {
  + if (isSimpleTagHandler) {
  + out.printin(simpleTagHandlerVar);
  + out.print(.setJspBody();
  + generateJspFragment(n, simpleTagHandlerVar);
  + out.println(););
  + } else {
  + visitBody(n);
  + }
}
}
   
  
  
  

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




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

2003-01-10 Thread luehe
luehe   2003/01/10 16:52:14

  Modified:jasper2/src/share/org/apache/jasper/compiler Generator.java
Node.java
  Log:
  Fixed 15961: getBodyContent() is not returning null when the action
  has only jsp:attribute actions within the body.
  
  Revision  ChangesPath
  1.147 +6 -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.146
  retrieving revision 1.147
  diff -u -r1.146 -r1.147
  --- Generator.java8 Jan 2003 22:15:56 -   1.146
  +++ Generator.java11 Jan 2003 00:52:14 -  1.147
  @@ -1958,7 +1958,7 @@
syncScriptingVars(n, VariableInfo.AT_BEGIN);
}
   
  - if (n.getBody() != null) {
  + if (!n.hasEmptyBody()) {
out.printin(if ();
out.print(tagEvalVar);
out.println( != javax.servlet.jsp.tagext.Tag.SKIP_BODY) {);
  @@ -2003,7 +2003,7 @@
   String tagHandlerVar,
   String tagEvalVar) {
   
  - if (n.getBody() != null) {
  + if (!n.hasEmptyBody()) {
if (n.implementsIterationTag()) {
out.printin(int evalDoAfterBody = );
out.print(tagHandlerVar);
  @@ -2120,7 +2120,7 @@
 * and pass it to tag handler's setJspBody(), unless tag body
 * is empty
 */
  - if (n.getBody() != null) {
  + if (!n.hasEmptyBody()) {
out.printin(tagHandlerVar);
out.print(.setJspBody();
generateJspFragment(n, tagHandlerVar);
  
  
  
  1.53  +34 -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.52
  retrieving revision 1.53
  diff -u -r1.52 -r1.53
  --- Node.java 11 Jan 2003 00:11:06 -  1.52
  +++ Node.java 11 Jan 2003 00:52:14 -  1.53
  @@ -1265,6 +1265,37 @@
}
return n;
}
  +
  + /**
  +  * Returns true if this custom action has an empty body, and false
  +  * otherwise.
  +  *
  +  * A custom action is considered to have an empty body if the 
  +  * following holds true:
  +  * - getBody() returns null, or
  +  * - all immediate children are jsp:attribute actions, or
  +  * - the action's jsp:body is empty.
  +  */
  +  public boolean hasEmptyBody() {
  +  boolean hasEmptyBody = true;
  +  Nodes nodes = getBody();
  +  if (nodes != null) {
  +  int numChildNodes = nodes.size();
  +  for (int i=0; inumChildNodes; i++) {
  +  Node n = nodes.getNode(i);
  +  if (!(n instanceof NamedAttribute)) {
  +  if (n instanceof JspBody) {
  +  hasEmptyBody = (n.getBody() == null);
  +  } else {
  +  hasEmptyBody = false;
  +  }
  +  break;
  +  }
  +  }
  +  }
  +
  +  return hasEmptyBody;
  +  }
   }
   
   /**
  
  
  

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




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

2003-01-08 Thread luehe
luehe   2003/01/08 10:42:43

  Modified:jasper2/src/share/org/apache/jasper/compiler Generator.java
Node.java Validator.java
  Log:
  Fixed 15854: Unable to provide a qname attribute value to the name
   attribute of the jsp:attribute action.
  
  Revision  ChangesPath
  1.145 +11 -11
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.144
  retrieving revision 1.145
  diff -u -r1.144 -r1.145
  --- Generator.java6 Jan 2003 18:57:14 -   1.144
  +++ Generator.java8 Jan 2003 18:42:42 -   1.145
  @@ -2388,17 +2388,17 @@
   }
   }
   
  - String attrName = attr.getName();
  + String localName = attr.getLocalName();
   
Method m = null;
Class[] c = null;
if (attr.isDynamic()) {
c = OBJECT_CLASS;
   } else {
  - m = handlerInfo.getSetterMethod(attrName);
  + m = handlerInfo.getSetterMethod(localName);
if (m == null) {
err.jspError(n, jsp.error.unable.to_find_method,
  -  attrName);
  +  attr.getName());
}
c = m.getParameterTypes();
// XXX assert(c.length  0)
  @@ -2410,8 +2410,8 @@
if (!n.checkIfAttributeIsJspFragment(attr.getName())
 !attr.isDynamic()) {
attrValue = convertString(
  -c[0], attrValue, attrName,
  - handlerInfo.getPropertyEditorClass(attrName),
  +c[0], attrValue, localName,
  + handlerInfo.getPropertyEditorClass(localName),
true);
}
} else if (attr.isELInterpreterInput()) {
  @@ -2420,8 +2420,8 @@
attrValue, c[0], n.getPrefix(), _jspx_fnmap, false );
   } else {
attrValue = convertString(
  -c[0], attrValue, attrName,
  - handlerInfo.getPropertyEditorClass(attrName),
  +c[0], attrValue, localName,
  + handlerInfo.getPropertyEditorClass(localName),
false);
}
return attrValue;
  @@ -2503,7 +2503,7 @@
} else {
out.printin(tagHandlerVar);
out.print(.);
  - 
out.print(handlerInfo.getSetterMethod(attrs[i].getName()).getName());
  + 
out.print(handlerInfo.getSetterMethod(attrs[i].getLocalName()).getName());
out.print(();
out.print(attrValue);
out.println(););
  
  
  
  1.51  +37 -11
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.50
  retrieving revision 1.51
  diff -u -r1.50 -r1.51
  --- Node.java 6 Jan 2003 18:57:15 -   1.50
  +++ Node.java 8 Jan 2003 18:42:43 -   1.51
  @@ -175,7 +175,15 @@
   int numChildNodes = nodes.size();
   for( int i = 0; i  numChildNodes; i++ ) {
   NamedAttribute na = (NamedAttribute)nodes.getNode( i );
  -if( na.getName().equals( name ) ) {
  + boolean found = false;
  + int index = name.indexOf(':');
  + if (index != -1) {
  + // qualified name
  + found = na.getName().equals(name);
  + } else {
  + found = na.getLocalName().equals(name);
  + }
  + if (found) {
   result = na;
   break;
   }
  @@ -1312,15 +1320,25 @@
   private boolean trim = true;
   
   private ChildInfo childInfo;
  + private String name;
  + private String localName;
  + private String prefix;
   
   public NamedAttribute( Attributes attrs, Mark start, Node parent) {
   super( attrs, start, parent );
  -this.temporaryVariableName = JspUtil.nextTemporaryVariableName();
  +temporaryVariableName = JspUtil.nextTemporaryVariableName();
   if( false.equals( this.getAttributeValue( trim ) ) ) {
   // (if null or true, leave default of true)
   trim = false;
   }
  -this.childInfo = new ChildInfo();
  +

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

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

  Modified:jasper2/src/share/org/apache/jasper/compiler Generator.java
  Log:
  Applied patch provided by Dimitry Ivanov to fix synchronization of
  AT_BEGIN and NESTED variables for tag handlers implementing BodyTag
  whose doStartTag() returns EVAL_BODY_INCLUDE
  
  Revision  ChangesPath
  1.146 +6 -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.145
  retrieving revision 1.146
  diff -u -r1.145 -r1.146
  --- Generator.java8 Jan 2003 18:42:42 -   1.145
  +++ Generator.java8 Jan 2003 22:15:56 -   1.146
  @@ -1980,12 +1980,13 @@
out.printin(tagHandlerVar);
out.println(.doInitBody(););
   
  + out.popIndent();
  + out.printil(});
  +
// Synchronize AT_BEGIN and NESTED scripting variables
syncScriptingVars(n, VariableInfo.AT_BEGIN);
syncScriptingVars(n, VariableInfo.NESTED);
   
  - out.popIndent();
  - out.printil(});
} else {
// Synchronize NESTED scripting variables
syncScriptingVars(n, VariableInfo.NESTED);
  
  
  

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




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

2003-01-08 Thread luehe
luehe   2003/01/08 14:24:29

  Modified:jasper2/src/share/org/apache/jasper/compiler Tag:
tomcat_4_branch Generator.java
  Log:
  Applied patch provided by Dimitry Ivanov to fix synchronization of
  AT_BEGIN and NESTED variables for tag handlers implementing BodyTag
  whose doStartTag() returns EVAL_BODY_INCLUDE
  
  Revision  ChangesPath
  No   revision
  
  
  No   revision
  
  
  1.35.2.14 +6 -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.13
  retrieving revision 1.35.2.14
  diff -u -r1.35.2.13 -r1.35.2.14
  --- Generator.java22 Nov 2002 23:47:31 -  1.35.2.13
  +++ Generator.java8 Jan 2003 22:24:28 -   1.35.2.14
  @@ -1376,12 +1376,13 @@
out.printin(tagHandlerVar);
out.println(.doInitBody(););
   
  + out.popIndent();
  + out.printil(});
  +
// Synchronize AT_BEGIN and NESTED scripting variables
syncScriptingVars(n, VariableInfo.AT_BEGIN);
syncScriptingVars(n, VariableInfo.NESTED);

  - out.popIndent();
  - out.printil(});
} else {
// Synchronize NESTED scripting variables
syncScriptingVars(n, VariableInfo.NESTED);
  
  
  

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




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

2002-12-16 Thread luehe
luehe   2002/12/16 08:13:28

  Modified:jasper2/src/share/org/apache/jasper/compiler Generator.java
Node.java Parser.java
  Log:
  Fixed 15364: The jsp:body action doesn't work as expected when used with the 
jsp:fallback action.
  
  Revision  ChangesPath
  1.142 +5 -12 
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.141
  retrieving revision 1.142
  diff -u -r1.141 -r1.142
  --- Generator.java12 Dec 2002 23:31:51 -  1.141
  +++ Generator.java16 Dec 2002 16:13:28 -  1.142
  @@ -1458,15 +1458,8 @@
 * Fallback
 */
if (n.getBody() != null) {
  - n.getBody().visit(new Node.Visitor() {
  - public void visit(Node.FallBackAction n) {
  - n.setBeginJavaLine(out.getJavaLine());
  - out.printil(out.write( +
  - quote(new String(n.getText())) + ););
  - out.printil(out.write(\\\n\););
  - n.setEndJavaLine(out.getJavaLine());
  - }
  - });
  + visitBody(n);
  + out.printil(out.write(\\\n\););
}
   
out.printil(out.write( + quote(/NOEMBED/EMBED) + ););
  
  
  
  1.49  +5 -5  
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.48
  retrieving revision 1.49
  diff -u -r1.48 -r1.49
  --- Node.java 13 Dec 2002 18:06:08 -  1.48
  +++ Node.java 16 Dec 2002 16:13:28 -  1.49
  @@ -682,8 +682,8 @@
*/
   public static class FallBackAction extends Node {
   
  - public FallBackAction(Mark start, String text, Node parent) {
  - super(text, start, parent);
  + public FallBackAction(Mark start, Node parent) {
  + super(start, parent);
}
   
public void accept(Visitor v) throws JasperException {
  
  
  
  1.47  +7 -20 
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.46
  retrieving revision 1.47
  diff -u -r1.46 -r1.47
  --- Parser.java   13 Dec 2002 15:44:39 -  1.46
  +++ Parser.java   16 Dec 2002 16:13:28 -  1.47
  @@ -1090,23 +1090,10 @@
*)
*/
   private void parseFallBack(Node parent) throws JasperException {
  -if( reader.matches( / ) ) {
  -// No elements, don't create node.
  -}
  -else if( reader.matches(  ) ) {
  -Mark bodyStart = reader.mark();
  -Mark bodyEnd = reader.skipUntilETag(jsp:fallback);
  -if (bodyEnd == null) {
  -err.jspError(start, jsp.error.unterminated, 
  -lt;jsp:fallback);
  -}
  -new Node.FallBackAction(start, reader.getText(bodyStart, bodyEnd),
  - parent);
  -}
  -else {
  -err.jspError( reader.mark(), jsp.error.unterminated,
  -lt;jsp:fallback );
  -}
  + Mark bodyStart = reader.mark();
  + Node fallBackNode = new Node.FallBackAction(start, parent);
  + parseOptionalBody(fallBackNode, jsp:fallback, 
  +   JAVAX_BODY_CONTENT_TEMPLATE_TEXT);
   }
   
   /*
  
  
  

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




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

2002-12-16 Thread kinman
kinman  2002/12/16 15:38:00

  Modified:jasper2/src/share/org/apache/jasper/compiler Generator.java
  Log:
  - Turn off XML escape for EL.
  
  Revision  ChangesPath
  1.143 +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.142
  retrieving revision 1.143
  diff -u -r1.142 -r1.143
  --- Generator.java16 Dec 2002 16:13:28 -  1.142
  +++ Generator.java16 Dec 2002 23:37:59 -  1.143
  @@ -843,7 +843,7 @@
   out.write(
+ JspUtil.interpreterCall(this.isTagFile,
   ${ + new String(n.getText()) + }, String.class,
  - null, _jspx_fnmap, true )
  + null, _jspx_fnmap, false )
   + ););
   } else {
   out.printil(out.write( +
  
  
  

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




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

2002-12-12 Thread luehe
luehe   2002/12/12 15:31:52

  Modified:jasper2/src/share/org/apache/jasper/runtime
JspRuntimeLibrary.java
   jasper2/src/share/org/apache/jasper/compiler Generator.java
  Log:
  Added support for named attributes whose associated attributes are of primitive type
  
  Revision  ChangesPath
  1.12  +10 -3 
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.11
  retrieving revision 1.12
  diff -u -r1.11 -r1.12
  --- JspRuntimeLibrary.java11 Dec 2002 22:34:06 -  1.11
  +++ JspRuntimeLibrary.java12 Dec 2002 23:31:51 -  1.12
  @@ -142,6 +142,13 @@
return new Character(s.charAt(0));
   }
   
  +public static char getChar(String s) throws JasperException {
  + if (s.length() == 0) {
  + err.jspError(jsp.error.bad_string_Character);
  + }
  + return s.charAt(0);
  +}
  +
  // __begin convertMethod
   public static Object convert(String propertyName, String s, Class t,
 Class propertyEditorClass) 
  
  
  
  1.141 +38 -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.140
  retrieving revision 1.141
  diff -u -r1.140 -r1.141
  --- Generator.java12 Dec 2002 03:30:58 -  1.140
  +++ Generator.java12 Dec 2002 23:31:51 -  1.141
  @@ -2537,7 +2537,10 @@
} else if (c == String.class) {
return quoted;
} else if (c == boolean.class) {
  - return Boolean.valueOf(s).toString();
  + if (isNamedAttribute)
  + return Boolean.valueOf( + s + ).booleanValue();
  + else
  + return Boolean.valueOf(s).toString();
} else if (c == Boolean.class) {
if (isNamedAttribute)
return new Boolean( + s + );
  @@ -2553,14 +2556,18 @@
// Detect format error at translation time
return new Byte((byte) + Byte.valueOf(s).toString() + );
} else if (c == char.class) {
  - // non-normative (normative method would fail to compile)
  - if (s.length()  0) {
  - char ch = s.charAt(0);
  - // this trick avoids escaping issues
  - return ((char)  + (int) ch + );
  + if (isNamedAttribute) {
  + return org.apache.jasper.runtime.JspRuntimeLibrary.getChar( + s 
+ );
} else {
  - throw new NumberFormatException(
  -err.getString(jsp.error.bad_string_char));
  + // non-normative (normative method would fail to compile)
  + if (s.length()  0) {
  + char ch = s.charAt(0);
  + // this trick avoids escaping issues
  + return ((char)  + (int) ch + );
  + } else {
  + throw new NumberFormatException(
  +err.getString(jsp.error.bad_string_char));
  + }
}
} else if (c == Character.class) {
if (isNamedAttribute) {
  @@ -2577,7 +2584,10 @@
}
}
} else if (c == double.class) {
  - return Double.valueOf(s).toString();
  + if (isNamedAttribute)
  + return Double.valueOf( + s + ).doubleValue();
  + else
  + return Double.valueOf(s).toString();
} else if (c == Double.class) {
if (isNamedAttribute)
return new Double( + s + );
  @@ -2585,7 +2595,10 @@
// Detect format error at translation time
return new Double( + Double.valueOf(s).toString() + );
} else if (c == float.class) {
  - return Float.valueOf(s).toString() + f;
  + if (isNamedAttribute)
  + return Float.valueOf( + s + ).floatValue();
  + else
  + return Float.valueOf(s).toString() + f;
} else if (c == Float.class) {
if (isNamedAttribute)
return new Float( + s + );
  @@ -2593,7 +2606,10 @@
// Detect format error at translation time
return new Float( + Float.valueOf(s).toString() + f);
} else if (c == int.class) {
  - return 

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

2002-12-11 Thread luehe
luehe   2002/12/11 11:40:46

  Modified:jasper2/src/share/org/apache/jasper/runtime
JspRuntimeLibrary.java
   jasper2/src/share/org/apache/jasper/compiler Generator.java
  Log:
  Added support for named attributes that do not evaluate to String
  
  Revision  ChangesPath
  1.10  +12 -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.9
  retrieving revision 1.10
  diff -u -r1.9 -r1.10
  --- JspRuntimeLibrary.java27 Nov 2002 02:54:46 -  1.9
  +++ JspRuntimeLibrary.java11 Dec 2002 19:40:45 -  1.10
  @@ -128,7 +128,15 @@
   return null;
   }
   }
  - 
  +
  +public static Character getCharacter(String s) throws JasperException {
  + if (s.length()  0) {
  + return new Character(s.charAt(0));
  + } else {
  + throw new 
JasperException(Constants.getString(jsp.error.bad_string_Character));
  + }
  +}
  +
  // __begin convertMethod
   public static Object convert(String propertyName, String s, Class t, Class 
propertyEditorClass) 
  throws JasperException 
  
  
  
  1.139 +54 -21
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.138
  retrieving revision 1.139
  diff -u -r1.138 -r1.139
  --- Generator.java5 Dec 2002 23:56:39 -   1.138
  +++ Generator.java11 Dec 2002 19:40:45 -  1.139
  @@ -2419,7 +2419,7 @@
attrValue = convertString(
   c[0], attrValue, attrName,
handlerInfo.getPropertyEditorClass(attrName),
  - false);
  + true);
}
} else if (attr.isELInterpreterInput()) {
   // run attrValue through the expression interpreter
  @@ -2429,7 +2429,7 @@
attrValue = convertString(
   c[0], attrValue, attrName,
handlerInfo.getPropertyEditorClass(attrName),
  - true);
  + false);
}
return attrValue;
}
  @@ -2519,11 +2519,12 @@
}
   
private String convertString(Class c, String s, String attrName,
  -  Class propEditorClass, boolean quote)
  +  Class propEditorClass,
  +  boolean isNamedAttribute)
throws JasperException {
   
String quoted = s;
  - if (quote) {
  + if (!isNamedAttribute) {
quoted = quote(s);
}
   
  @@ -2538,11 +2539,19 @@
} else if (c == boolean.class) {
return Boolean.valueOf(s).toString();
} else if (c == Boolean.class) {
  - return new Boolean( + Boolean.valueOf(s).toString() + );
  + if (isNamedAttribute)
  + return new Boolean( + s + );
  + else
  + // Detect format error at translation time
  + return new Boolean( + Boolean.valueOf(s).toString() + );
} else if (c == byte.class) {
return ((byte) + Byte.valueOf(s).toString() + );
} else if (c == Byte.class) {
  - return new Byte((byte) + Byte.valueOf(s).toString() + );
  + if (isNamedAttribute)
  + return new Byte( + s + );
  + else
  + // Detect format error at translation time
  + return new Byte((byte) + Byte.valueOf(s).toString() + );
} else if (c == char.class) {
// non-normative (normative method would fail to compile)
if (s.length()  0) {
  @@ -2554,35 +2563,59 @@
   err.getString(jsp.error.bad_string_char));
}
} else if (c == Character.class) {
  - // non-normative (normative method would fail to compile)
  - if (s.length()  0) {
  - char ch = s.charAt(0);
  - // this trick avoids escaping issues
  - return new Character((char)  + (int) ch + );
  + if (isNamedAttribute) {
  + return org.apache.jasper.runtime.JspRuntimeLibrary.getCharacter( 
+ s + );
} else {
  - throw new NumberFormatException(
  -

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

2002-12-11 Thread luehe
luehe   2002/12/11 19:30:59

  Modified:jasper2/src/share/org/apache/jasper/compiler Generator.java
JspDocumentParser.java Node.java Parser.java
  Log:
  - Allow empty jsp:attribute body, and treat it as .
  - In a JSP document (XML syntax), preserve any leading and trailing
white-space-only textual nodes in a jsp:attribute whose 'trim' attribute
is set to FALSE (these nodes are dropped otherwise).
  
  Revision  ChangesPath
  1.140 +30 -25
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.139
  retrieving revision 1.140
  diff -u -r1.139 -r1.140
  --- Generator.java11 Dec 2002 19:40:45 -  1.139
  +++ Generator.java12 Dec 2002 03:30:58 -  1.140
  @@ -2687,8 +2687,8 @@
* @return The name of the temporary variable the result is stored in.
*/
   public String generateNamedAttributeValue( Node.NamedAttribute n )
  -throws JasperException
  -{
  +throws JasperException {
  +
   String varName = n.getTemporaryVariableName();
   
   // If the only body element for this named attribute node is
  @@ -2696,29 +2696,34 @@
   // pushBody and popBody.  Maybe we can further optimize
   // here by getting rid of the temporary variable, but in
   // reality it looks like javac does this for us.
  -boolean templateTextOptimization = false;
   Node.Nodes body = n.getBody();
  -if( body.size() == 1 ) {
  -Node bodyElement = body.getNode( 0 );
  -if( bodyElement instanceof Node.TemplateText ) {
  -templateTextOptimization = true;
  -out.printil( String  + varName +  =  +
  -quote( new String(
  -((Node.TemplateText)bodyElement).getText() ) ) + ; );
  -}
  -}
  + if (body != null) {
  + boolean templateTextOptimization = false;
  + if( body.size() == 1 ) {
  + Node bodyElement = body.getNode( 0 );
  + if( bodyElement instanceof Node.TemplateText ) {
  + templateTextOptimization = true;
  + out.printil(String  + varName +  = 
  + + quote(new 
String(((Node.TemplateText)bodyElement).getText()))
  + + ;);
  + }
  + }
   
  -// XXX - Another possible optimization would be for
  -// lone EL expressions (no need to pushBody here either).
  + // XXX - Another possible optimization would be for
  + // lone EL expressions (no need to pushBody here either).
   
  -if( !templateTextOptimization ) {
  -out.printil( out = pageContext.pushBody(); );
  -visitBody( n );
  -out.printil( String  + varName +  =  +
  -  ((javax.servlet.jsp.tagext.BodyContent) +
  -  out).getString(); );
  -out.printil( out = pageContext.popBody(); );
  -}
  + if( !templateTextOptimization ) {
  + out.printil( out = pageContext.pushBody(); );
  + visitBody( n );
  + out.printil( String  + varName +  =  +
  +  ((javax.servlet.jsp.tagext.BodyContent) +
  +  out).getString(); );
  + out.printil( out = pageContext.popBody(); );
  + }
  + } else {
  + // Empty body must be treated as 
  + out.printil(String  + varName +  = \\;); 
  + }
   
   return varName;
   }
  
  
  
  1.33  +38 -24
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.32
  retrieving revision 1.33
  diff -u -r1.32 -r1.33
  --- JspDocumentParser.java10 Dec 2002 21:33:35 -  1.32
  +++ JspDocumentParser.java12 Dec 2002 03:30:58 -  1.33
  @@ -349,12 +349,15 @@
   int offset,
   int len) throws SAXException {
/*
  -  * All textual nodes that have only white space are to be dropped from
  -  * the document, except for nodes in a jsp:text element, which are 
  -  * kept verbatim (JSP 5.2.1).
  +  * JSP.6.1.1: All 

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

2002-12-03 Thread luehe
luehe   2002/12/03 15:49:46

  Modified:jasper2/src/share/org/apache/jasper/compiler Generator.java
  Log:
  Do not call the setParent() method on SimpleTag handlers if the value
  being passed is null, since SimpleTag instances are not reused
  
  Revision  ChangesPath
  1.135 +11 -7 
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.134
  retrieving revision 1.135
  diff -u -r1.134 -r1.135
  --- Generator.java3 Dec 2002 23:17:48 -   1.134
  +++ Generator.java3 Dec 2002 23:49:46 -   1.135
  @@ -2378,10 +2378,14 @@
out.println(););
}
} else {
  - out.printin(tagHandlerVar);
  - out.print(.setParent();
  - out.print(parent);
  - out.println(););
  + // The setParent() method need not be called if the value being
  + // passed is null, since SimpleTag instances are not reused
  + if (parent != null) {
  + out.printin(tagHandlerVar);
  + out.print(.setParent();
  + out.print(parent);
  + out.println(););
  + }
}
   
Node.JspAttribute[] attrs = n.getJspAttributes();
  
  
  

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




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

2002-11-25 Thread kinman
kinman  2002/11/25 17:25:29

  Modified:jasper2/src/share/org/apache/jasper/compiler Generator.java
Node.java TagPluginManager.java
  Log:
  - Revert changes for tag plugin work.  I changed my mind.  :-)
  
  Revision  ChangesPath
  1.131 +64 -80
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.130
  retrieving revision 1.131
  diff -u -r1.130 -r1.131
  --- Generator.java23 Nov 2002 01:36:49 -  1.130
  +++ Generator.java26 Nov 2002 01:25:29 -  1.131
  @@ -1558,8 +1558,6 @@
   generateLocalVariables( out, n );
   }
   
  - prepareCustomAttributes(n, handlerInfo);
  -
if (n.implementsSimpleTag()) {
generateCustomDoTag(n, handlerInfo, tagHandlerVar);
} else {
  @@ -1881,69 +1879,6 @@
}
}
   
  - /**
  -  * Preprocess the attributes for the custom tag, except fragment
  -  * attributes.
  -  */
  - private void prepareCustomAttributes(Node.CustomTag n,
  -  TagHandlerInfo handlerInfo)
  -throws JasperException {
  -
  -Node.JspAttribute[] attrs = n.getJspAttributes();
  -for (int i=0; iattrs.length; i++) {
  -String attrValue = attrs[i].getValue();
  -if (attrValue == null) {
  -if (attrs[i].isNamedAttribute() ) {
  -if (!n.checkIfAttributeIsJspFragment(
  - attrs[i].getName())) {
  -attrValue = generateNamedAttributeValue(
  -attrs[i].getNamedAttributeNode() );
  -}
  -}
  -else {
  -continue;
  -}
  -}
  -String attrName = attrs[i].getName();
  -
  -Method m = null;
  -Class[] c = null;
  -if (attrs[i].isDynamic()) {
  -c = OBJECT_CLASS;
  -} else {
  -m = handlerInfo.getSetterMethod(attrName);
  -if (m == null) {
  -err.jspError(n, jsp.error.unable.to_find_method,
  - attrName);
  -}
  -c = m.getParameterTypes();
  -// XXX assert(c.length  0)
  -}
  -
  -if (attrs[i].isExpression()) {
  -// Do nothing
  -} else if (attrs[i].isNamedAttribute()) {
  -if (!n.checkIfAttributeIsJspFragment(attrs[i].getName())
  - !attrs[i].isDynamic()) {
  -attrValue = convertString(
  -c[0], attrValue, attrName,
  -handlerInfo.getPropertyEditorClass(attrName),
  -false);
  -}
  -} else if (attrs[i].isELInterpreterInput()) {
  -// run attrValue through the expression interpreter
  -attrValue = JspUtil.interpreterCall(this.isTagFile,
  -attrValue, c[0], n.getPrefix(), _jspx_fnmap );
  -} else {
  -attrValue = convertString(
  -c[0], attrValue, attrName,
  -handlerInfo.getPropertyEditorClass(attrName),
  -true);
  -}
  - attrs[i].setProcessedValue(attrValue);
  - }
  - }
  -
private void generateCustomStart(Node.CustomTag n,
 TagHandlerInfo handlerInfo,
 String tagHandlerVar,
  @@ -2449,20 +2384,70 @@
out.println(););
}
   
  -Node.JspAttribute[] attrs = n.getJspAttributes();
  -for (int i=0; iattrs.length; i++) {
  -String attrValue = attrs[i].getProcessedValue();
  - if (attrValue == null  attrs[i].isNamedAttribute() 
  - n.checkIfAttributeIsJspFragment(attrs[i].getName())) {
  - // XXX - no need to generate temporary variable here
  - attrValue = generateNamedAttributeJspFragment(
  + Node.JspAttribute[] attrs = n.getJspAttributes();
  + for (int i=0; iattrs.length; i++) {
  + String attrValue = attrs[i].getValue();
  + if (attrValue == null) {
  +if( attrs[i].isNamedAttribute() ) {
  + 

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

2002-11-22 Thread luehe
luehe   2002/11/22 15:47:15

  Modified:jasper2/src/share/org/apache/jasper/compiler Generator.java
  Log:
  Fixed 14699: Scripting variables declared AT_END do not work when tag
   implements TryCatchFinally.
  
  Revision  ChangesPath
  1.129 +9 -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.128
  retrieving revision 1.129
  diff -u -r1.128 -r1.129
  --- Generator.java19 Nov 2002 00:49:42 -  1.128
  +++ Generator.java22 Nov 2002 23:47:15 -  1.129
  @@ -2023,10 +2023,6 @@
// Synchronize AT_BEGIN scripting variables
syncScriptingVars(n, VariableInfo.AT_BEGIN);
   
  - // Declare and synchronize AT_END scripting variables
  - declareScriptingVars(n, VariableInfo.AT_END);
  - syncScriptingVars(n, VariableInfo.AT_END);
  -
// TryCatchFinally
if (n.implementsTryCatchFinally()) {
   out.popIndent(); // try
  @@ -2050,8 +2046,13 @@
   
if (n.implementsTryCatchFinally()) {
   out.popIndent();
  -out.println(});
  +out.printil(});
}
  +
  + // Declare and synchronize AT_END scripting variables (must do this
  + // outside the try/catch/finally block)
  + declareScriptingVars(n, VariableInfo.AT_END);
  + syncScriptingVars(n, VariableInfo.AT_END);
   
restoreScriptingVars(n, VariableInfo.AT_BEGIN);
   
  
  
  

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




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

2002-11-22 Thread luehe
luehe   2002/11/22 15:47:32

  Modified:jasper2/src/share/org/apache/jasper/compiler Tag:
tomcat_4_branch Generator.java
  Log:
  Fixed 14699: Scripting variables declared AT_END do not work when tag
   implements TryCatchFinally.
  
  Revision  ChangesPath
  No   revision
  
  
  No   revision
  
  
  1.35.2.13 +9 -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.35.2.12
  retrieving revision 1.35.2.13
  diff -u -r1.35.2.12 -r1.35.2.13
  --- Generator.java19 Nov 2002 00:51:05 -  1.35.2.12
  +++ Generator.java22 Nov 2002 23:47:31 -  1.35.2.13
  @@ -1445,10 +1445,6 @@
// Synchronize AT_BEGIN scripting variables
syncScriptingVars(n, VariableInfo.AT_BEGIN);
   
  - // Declare and synchronize AT_END scripting variables
  - declareScriptingVars(n, VariableInfo.AT_END);
  - syncScriptingVars(n, VariableInfo.AT_END);
  -
// TryCatchFinally
if (n.implementsTryCatchFinally()) {
   out.popIndent(); // try
  @@ -1472,8 +1468,13 @@
   
if (n.implementsTryCatchFinally()) {
   out.popIndent();
  -out.println(});
  +out.printil(});
}
  +
  + // Declare and synchronize AT_END scripting variables (must do this
  + // outside the try/catch/finally block)
  + declareScriptingVars(n, VariableInfo.AT_END);
  + syncScriptingVars(n, VariableInfo.AT_END);
   
restoreScriptingVars(n, VariableInfo.AT_BEGIN);
   
  
  
  

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




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

2002-11-18 Thread kinman
kinman  2002/11/18 16:49:42

  Modified:jasper2/src/share/org/apache/jasper/compiler Generator.java
  Log:
  - Fix 14577: Declarations should geneate a '\n' at end.
  
  Revision  ChangesPath
  1.128 +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.127
  retrieving revision 1.128
  diff -u -r1.127 -r1.128
  --- Generator.java16 Nov 2002 04:20:10 -  1.127
  +++ Generator.java19 Nov 2002 00:49:42 -  1.128
  @@ -165,6 +165,7 @@
   
public void visit(Node.Declaration n) throws JasperException {
out.printMultiLn(new String(n.getText()));
  + out.println();
}
}
   
  
  
  

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




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

2002-11-18 Thread kinman
kinman  2002/11/18 16:51:05

  Modified:jasper2/src/share/org/apache/jasper/compiler Tag:
tomcat_4_branch Generator.java
  Log:
  - Fix 14577: Declarations should geneate a '\n' at end.
  
  Revision  ChangesPath
  No   revision
  
  
  No   revision
  
  
  1.35.2.12 +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.35.2.11
  retrieving revision 1.35.2.12
  diff -u -r1.35.2.11 -r1.35.2.12
  --- Generator.java4 Nov 2002 21:24:42 -   1.35.2.11
  +++ Generator.java19 Nov 2002 00:51:05 -  1.35.2.12
  @@ -161,6 +161,7 @@
   
public void visit(Node.Declaration n) throws JasperException {
out.printMultiLn(new String(n.getText()));
  + out.println();
}
}
   
  
  
  

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




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

2002-11-15 Thread luehe
luehe   2002/11/15 11:41:28

  Modified:jasper2/src/share/org/apache/jasper/compiler Generator.java
  Log:
  Optimization: Do not create JSP fragment for simple tag invocation if
  tag body is empty
  
  Revision  ChangesPath
  1.126 +14 -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.125
  retrieving revision 1.126
  diff -u -r1.125 -r1.126
  --- Generator.java13 Nov 2002 17:40:38 -  1.125
  +++ Generator.java15 Nov 2002 19:41:28 -  1.126
   -1843,8 +1843,11 
}
out.printil(try {);
out.pushIndent();
  + out.printil(if (getJspBody() != null));
  + out.pushIndent();
out.printil(getJspBody().invoke(_jspx_sout););
out.popIndent();
  + out.popIndent();
out.printil( } finally { );
out.pushIndent();
// Copy page scope of invoking page back to virtual page scope of
   -2082,12 +2085,15 
if (findJspBody(n) == null) {
/*
 * Encapsulate body of custom tag invocation in JspFragment
  -  * and pass it to tag handler's setJspBody()
  +  * and pass it to tag handler's setJspBody(), unless tag body
  +  * is empty
 */
  - out.printin(tagHandlerVar);
  - out.print(.setJspBody();
  - generateJspFragment(n, tagHandlerVar);
  - out.println(););
  + if (n.getBody() != null) {
  + out.printin(tagHandlerVar);
  + out.print(.setJspBody();
  + generateJspFragment(n, tagHandlerVar);
  + out.println(););
  + }
} else {
/*
 * Body of tag is the body of the jsp:body element.
  
  
  

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




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

2002-11-07 Thread luehe
luehe   2002/11/07 11:09:03

  Modified:jasper2/src/share/org/apache/jasper/compiler Generator.java
  Log:
  Use 'this' qualifier to disambiguate jspContext instance
  (e.g., required when invoking fragment from within simple tag).
  
  Revision  ChangesPath
  1.122 +11 -11
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.121
  retrieving revision 1.122
  diff -u -r1.121 -r1.122
  --- Generator.java6 Nov 2002 22:49:07 -   1.121
  +++ Generator.java7 Nov 2002 19:09:03 -   1.122
   -1832,8 +1832,8 
   
// Copy virtual page scope of tag file to page scope of invoking
// page
  - out.printil(((org.apache.jasper.runtime.JspContextWrapper) 
jspContext).copyTagToPageScope(javax.servlet.jsp.tagext.VariableInfo.NESTED););
  - out.printil(((org.apache.jasper.runtime.JspContextWrapper) 
jspContext).copyTagToPageScope(javax.servlet.jsp.tagext.VariableInfo.AT_BEGIN););
  + out.printil(((org.apache.jasper.runtime.JspContextWrapper) 
this.jspContext).copyTagToPageScope(javax.servlet.jsp.tagext.VariableInfo.NESTED););
  + out.printil(((org.apache.jasper.runtime.JspContextWrapper) 
this.jspContext).copyTagToPageScope(javax.servlet.jsp.tagext.VariableInfo.AT_BEGIN););
   
// Invoke fragment
String varReaderAttr = n.getTextAttribute(varReader);
   -1852,8 +1852,8 
out.pushIndent();
// Copy page scope of invoking page back to virtual page scope of
// tag file
  - out.printil(((org.apache.jasper.runtime.JspContextWrapper) 
jspContext).copyPageToTagScope(javax.servlet.jsp.tagext.VariableInfo.NESTED););
  - out.printil(((org.apache.jasper.runtime.JspContextWrapper) 
jspContext).copyPageToTagScope(javax.servlet.jsp.tagext.VariableInfo.AT_BEGIN););
  + out.printil(((org.apache.jasper.runtime.JspContextWrapper) 
this.jspContext).copyPageToTagScope(javax.servlet.jsp.tagext.VariableInfo.NESTED););
  + out.printil(((org.apache.jasper.runtime.JspContextWrapper) 
this.jspContext).copyPageToTagScope(javax.servlet.jsp.tagext.VariableInfo.AT_BEGIN););
out.popIndent();
out.printil(});
   
   -1880,8 +1880,8 
   
// Copy virtual page scope of tag file to page scope of invoking
// page
  - out.printil(((org.apache.jasper.runtime.JspContextWrapper) 
jspContext).copyTagToPageScope(javax.servlet.jsp.tagext.VariableInfo.NESTED););
  - out.printil(((org.apache.jasper.runtime.JspContextWrapper) 
jspContext).copyTagToPageScope(javax.servlet.jsp.tagext.VariableInfo.AT_BEGIN););
  + out.printil(((org.apache.jasper.runtime.JspContextWrapper) 
this.jspContext).copyTagToPageScope(javax.servlet.jsp.tagext.VariableInfo.NESTED););
  + out.printil(((org.apache.jasper.runtime.JspContextWrapper) 
this.jspContext).copyTagToPageScope(javax.servlet.jsp.tagext.VariableInfo.AT_BEGIN););
   
// Invoke body
String varReaderAttr = n.getTextAttribute(varReader);
   -1899,8 +1899,8 
out.pushIndent();
// Copy page scope of invoking page back to virtual page scope of
// tag file
  - out.printil(((org.apache.jasper.runtime.JspContextWrapper) 
jspContext).copyPageToTagScope(javax.servlet.jsp.tagext.VariableInfo.NESTED););
  - out.printil(((org.apache.jasper.runtime.JspContextWrapper) 
jspContext).copyPageToTagScope(javax.servlet.jsp.tagext.VariableInfo.AT_BEGIN););
  + out.printil(((org.apache.jasper.runtime.JspContextWrapper) 
this.jspContext).copyPageToTagScope(javax.servlet.jsp.tagext.VariableInfo.NESTED););
  + out.printil(((org.apache.jasper.runtime.JspContextWrapper) 
this.jspContext).copyPageToTagScope(javax.servlet.jsp.tagext.VariableInfo.AT_BEGIN););
out.popIndent();
out.printil(});
   
  
  
  

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




  1   2   >