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

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

2002-10-18 Thread luehe
luehe   2002/10/17 14:38:56

  Modified:jasper2/src/share/org/apache/jasper/compiler Generator.java
Node.java Parser.java TagLibraryInfoImpl.java
Validator.java
  Log:
  Check for null before enumerating over array returned by TagInfo.getAttributes() and 
TagInfo.getTagVariableInfos() (see Bugzilla 13619).
  
  Revision  ChangesPath
  1.111 +5 -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.110
  retrieving revision 1.111
  diff -u -r1.110 -r1.111
  --- Generator.java17 Oct 2002 20:43:06 -  1.110
  +++ Generator.java17 Oct 2002 21:38:56 -  1.111
   -2109,9 +2109,6 
   String tagHandlerVar,
   String tagEvalVar) {
   
  - VariableInfo[] varInfos = n.getVariableInfos();
  - TagVariableInfo[] tagVarInfos = n.getTagVariableInfos();
  -
if (n.getBody() != null) {
if (n.implementsIterationTag()) {
out.printin(int evalDoAfterBody = );
   -3081,8 +3078,8 
   out.printil( // Sync up variables with caller's page context: );
   
   TagVariableInfo[] tagVariableInfo = tagInfo.getTagVariableInfos();
  -
  -for( int i = 0; i  tagVariableInfo.length; i++ ) {
  +for( int i = 0; tagVariableInfo != null
  +   i  tagVariableInfo.length; i++ ) {
   // XXX - Spec bug: Note, we don't know the value of 
   // this attribute at translation time, because we're defining
   // the tag, and we don't know how page authors will call it.
  
  
  
  1.35  +4 -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.34
  retrieving revision 1.35
  diff -u -r1.34 -r1.35
  --- Node.java 17 Oct 2002 20:43:06 -  1.34
  +++ Node.java 17 Oct 2002 21:38:56 -  1.35
   -1183,7 +1183,7 
   boolean result = false;
   
TagAttributeInfo[] attributes = tagInfo.getAttributes();
  - for (int i = 0; i  attributes.length; i++) {
  + for (int i = 0; attributes != null  i  attributes.length; i++) {
if (attributes[i].getName().equals(name) 
attributes[i].isFragment()) {
result = true;
  
  
  
  1.35  +4 -4  
jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/compiler/Parser.java
  
  Index: Parser.java
  ===
  RCS file: 
/home/cvs/jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/compiler/Parser.java,v
  retrieving revision 1.34
  retrieving revision 1.35
  diff -u -r1.34 -r1.35
  --- Parser.java   17 Oct 2002 20:43:06 -  1.34
  +++ Parser.java   17 Oct 2002 21:38:56 -  1.35
   -1718,7 +1718,7 
if (n instanceof Node.CustomTag) {
TagInfo tagInfo = ((Node.CustomTag)n).getTagInfo();
TagAttributeInfo[] tldAttrs = tagInfo.getAttributes();
  - for (int i=0; itldAttrs.length; i++) {
  + for (int i=0; tldAttrs != null  itldAttrs.length; i++) {
if (name.equals(tldAttrs[i].getName())) {
if (tldAttrs[i].isFragment()) {
return TagInfo.BODY_CONTENT_SCRIPTLESS;
  
  
  
  1.20  +15 -10
jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/compiler/TagLibraryInfoImpl.java
  
  Index: TagLibraryInfoImpl.java
  ===
  RCS file: 
/home/cvs/jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/compiler/TagLibraryInfoImpl.java,v
  retrieving revision 1.19
  retrieving revision 1.20
  diff -u -r1.19 -r1.20
  --- TagLibraryInfoImpl.java   17 Oct 2002 20:43:06 -  1.19
  +++ TagLibraryInfoImpl.java   17 Oct 2002 21:38:56 -  1.20
   -372,13 +372,18 
 );
}
}
  - TagAttributeInfo[] tagAttributeInfo 
  -= new TagAttributeInfo[attributeVector.size()];
  - attributeVector.copyInto(tagAttributeInfo);
   
  - TagVariableInfo[] tagVariableInfos
  -= new TagVariableInfo[variableVector.size()];
  - variableVector.copyInto(tagVariableInfos);
  + TagAttributeInfo[] tagAttributeInfo = null;
  + if (attributeVector.size()  0) {
  +tagAttributeInfo = new TagAttributeInfo[attributeVector.size()];
  + 

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

2002-09-09 Thread luehe

luehe   2002/09/09 17:36:24

  Modified:jasper2/src/share/org/apache/jasper/compiler Tag:
tomcat_4_branch Generator.java Node.java
ScriptingVariabler.java
  Log:
  Fixed 12432: Can't compile JSP with nested custom tags that have VariableInfo
  
  Revision  ChangesPath
  No   revision
  
  
  No   revision
  
  
  1.35.2.8  +73 -94
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.7
  retrieving revision 1.35.2.8
  diff -u -r1.35.2.7 -r1.35.2.8
  --- Generator.java9 Sep 2002 17:30:00 -   1.35.2.7
  +++ Generator.java10 Sep 2002 00:36:23 -  1.35.2.8
  @@ -1144,27 +1144,15 @@
}
}
   
  - Class tagHandlerClass = handlerInfo.getTagHandlerClass();
  - boolean implementsIterationTag = 
  - IterationTag.class.isAssignableFrom(tagHandlerClass);
  - boolean implementsBodyTag = 
  - BodyTag.class.isAssignableFrom(tagHandlerClass);
  - boolean implementsTryCatchFinally = 
  - TryCatchFinally.class.isAssignableFrom(tagHandlerClass);
  -
// Generate code for start tag, body, and end tag
  - generateCustomStart(n, handlerInfo, tagHandlerVar, tagEvalVar,
  -   implementsIterationTag, implementsBodyTag,
  -   implementsTryCatchFinally);
  + generateCustomStart(n, handlerInfo, tagHandlerVar, tagEvalVar);
   
String tmpParent = parent;
parent = tagHandlerVar;
visitBody(n);
   
parent = tmpParent;
  - generateCustomEnd(n, tagHandlerVar, tagEvalVar,
  -   implementsIterationTag, implementsBodyTag,
  -   implementsTryCatchFinally);
  + generateCustomEnd(n, tagHandlerVar, tagEvalVar);
   
if (n.isScriptless()  !n.hasScriptingVars()) {
// Generate end of method
  @@ -1289,10 +1277,7 @@
private void generateCustomStart(Node.CustomTag n,
 TagHandlerInfo handlerInfo,
 String tagHandlerVar,
  -  String tagEvalVar,
  -  boolean implementsIterationTag,
  -  boolean implementsBodyTag,
  -  boolean implementsTryCatchFinally)
  +  String tagEvalVar)
throws JasperException {
   
Class tagHandlerClass = handlerInfo.getTagHandlerClass();
  @@ -1304,13 +1289,7 @@
   
// Declare AT_BEGIN scripting variables
declareScriptingVars(n, VariableInfo.AT_BEGIN);
  -
  - /*
  -  * Save current values of scripting variables, so that the 
  -  * scripting variables may be synchronized without affecting their
  -  * original values
  -  */
  - saveScriptingVars(n);
  + saveScriptingVars(n, VariableInfo.AT_BEGIN);
   
out.printin(tagHandlerClass.getName());
out.print( );
  @@ -1332,7 +1311,7 @@
   
generateSetters(n, tagHandlerVar, handlerInfo);

  -if (implementsTryCatchFinally) {
  +if (n.implementsTryCatchFinally()) {
   out.printil(try {);
   out.pushIndent();
   }
  @@ -1342,12 +1321,9 @@
out.print(tagHandlerVar);
out.println(.doStartTag(););
   
  - if (!implementsIterationTag) {
  + if (!n.implementsBodyTag()) {
// Synchronize AT_BEGIN scripting variables
syncScriptingVars(n, VariableInfo.AT_BEGIN);
  - // Declare and synchronize NESTED scripting variables
  - declareScriptingVars(n, VariableInfo.NESTED);
  - syncScriptingVars(n, VariableInfo.NESTED);
}
   
if (n.getBody() != null) {
  @@ -1356,37 +1332,37 @@
out.println( != javax.servlet.jsp.tagext.Tag.SKIP_BODY) {);
out.pushIndent();

  - if (implementsIterationTag) {
  - // Declare NESTED scripting variables
  - declareScriptingVars(n, VariableInfo.NESTED);
  -
  - if (n.implementsBodyTag()) {
  - out.printin(if ();
  - out.print(tagEvalVar);
  - out.println( != 
javax.servlet.jsp.tagext.Tag.EVAL_BODY_INCLUDE) {);
  - // Assume EVAL_BODY_BUFFERED
  - out.pushIndent();
  - 

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

2002-07-18 Thread luehe

luehe   2002/07/18 14:17:27

  Modified:jasper2/src/share/org/apache/jasper/compiler Generator.java
Node.java
  Log:
  Fixed Bug# 10670: Problem in JSP compilation
  
  Revision  ChangesPath
  1.42  +13 -54
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.41
  retrieving revision 1.42
  diff -u -r1.41 -r1.42
  --- Generator.java17 Jul 2002 21:13:38 -  1.41
  +++ Generator.java18 Jul 2002 21:17:27 -  1.42
  @@ -1959,64 +1959,23 @@
}
   
/*
  -  * Declares any NESTED scripting variables of the given custom tag,
  -  * if the given custom tag is not nested inside itself (i.e, has a
  -  * nesting level of zero). If the custom tag does have a custom nesting
  -  * level greater than 0, this method declares a scripting variable
  -  * derived from the tag's id attribute (if present), only if its
  -  * scope is NESTED and it does not match the id attribute of any of
  -  * the enclosing tags of the same (custom) type.
  -  *
  -  * Additionally, a NESTED scripting variable is declared only if it
  -  * has not already been declared in the same Java
  -  * scope of the generated code, that is, if this custom tag's parent is
  -  * different from the parent of the custom tag that may already have
  -  * declared this variable.
  +  * Declares any NESTED scripting variables of the given custom tag.
 */
private void declareNestedScriptingVariables(Node.CustomTag n) {
   
  - if (n.getCustomNestingLevel()  0  !n.hasUnnestedIdAttribute()) {
  - return;
  - }
  -
TagVariableInfo[] tagVarInfos = n.getTagVariableInfos();
  - VariableInfo[] varInfos = n.getVariableInfos();
  - if ((varInfos == null)  (tagVarInfos == null)) {
  + VariableInfo[] nestedVarInfos = n.getNestedVariableInfos();
  + if ((nestedVarInfos == null)  (tagVarInfos == null)) {
return;
}
   
  - if (varInfos != null) {
  - if (n.getCustomNestingLevel() == 0) {
  - // Declare *any* scripting variables with NESTED scope
  - for (int i=0; ivarInfos.length; i++) {
  - if ((varInfos[i].getScope() == VariableInfo.NESTED)
  -  varInfos[i].getDeclare()) {
  - String name = varInfos[i].getVarName();
  - out.printin(varInfos[i].getClassName());
  - out.print( );
  - out.print(name);
  - out.println( = null;);
  - }
  - }
  - } else {
  - /*
  -  * Declare only scripting variable (with NESTED scope)
  -  * derived from unnested id attribute
  -  */
  - String idAttr = n.getAttributeValue(id);
  - for (int i=0; ivarInfos.length; i++) {
  - if ((varInfos[i].getScope() == VariableInfo.NESTED)
  -  varInfos[i].getDeclare()) {
  - String name = varInfos[i].getVarName();
  - if (idAttr.equals(name)) {
  - out.printin(varInfos[i].getClassName());
  - out.print( );
  - out.print(name);
  - out.println( = null;);
  - break;
  - }
  - }
  - }
  + if (nestedVarInfos != null) {
  + for (int i=0; inestedVarInfos.length; i++) {
  + String name = nestedVarInfos[i].getVarName();
  + out.printin(nestedVarInfos[i].getClassName());
  + out.print( );
  + out.print(name);
  + out.println( = null;);
}
} else {
for (int i=0; itagVarInfos.length; i++) {
  
  
  
  1.18  +50 -30
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.17
  retrieving revision 1.18
  diff -u -r1.17 -r1.18
  --- Node.java 17 Jul 2002 20:06:59 -  1.17
  +++ Node.java 18 Jul 2002 21:17:27 -  1.18
  @@ -791,8 +791,8 @@
private TagInfo tagInfo;
private Class tagHandlerClass;
private VariableInfo[] varInfos;
  + private 

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

2002-07-18 Thread luehe

luehe   2002/07/18 14:34:09

  Modified:jasper2/src/share/org/apache/jasper/compiler Tag:
tomcat_4_branch Generator.java Node.java
  Log:
  Fixed Bug# 10670: Problem in JSP compilation
  
  Revision  ChangesPath
  No   revision
  
  
  No   revision
  
  
  1.35.2.1  +13 -54
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
  retrieving revision 1.35.2.1
  diff -u -r1.35 -r1.35.2.1
  --- Generator.java27 Jun 2002 17:32:17 -  1.35
  +++ Generator.java18 Jul 2002 21:34:08 -  1.35.2.1
  @@ -1490,64 +1490,23 @@
}
   
/*
  -  * Declares any NESTED scripting variables of the given custom tag,
  -  * if the given custom tag is not nested inside itself (i.e, has a
  -  * nesting level of zero). If the custom tag does have a custom nesting
  -  * level greater than 0, this method declares a scripting variable
  -  * derived from the tag's id attribute (if present), only if its
  -  * scope is NESTED and it does not match the id attribute of any of
  -  * the enclosing tags of the same (custom) type.
  -  *
  -  * Additionally, a NESTED scripting variable is declared only if it
  -  * has not already been declared in the same Java
  -  * scope of the generated code, that is, if this custom tag's parent is
  -  * different from the parent of the custom tag that may already have
  -  * declared this variable.
  +  * Declares any NESTED scripting variables of the given custom tag.
 */
private void declareNestedScriptingVariables(Node.CustomTag n) {
   
  - if (n.getCustomNestingLevel()  0  !n.hasUnnestedIdAttribute()) {
  - return;
  - }
  -
TagVariableInfo[] tagVarInfos = n.getTagVariableInfos();
  - VariableInfo[] varInfos = n.getVariableInfos();
  - if ((varInfos == null)  (tagVarInfos == null)) {
  + VariableInfo[] nestedVarInfos = n.getNestedVariableInfos();
  + if ((nestedVarInfos == null)  (tagVarInfos == null)) {
return;
}
   
  - if (varInfos != null) {
  - if (n.getCustomNestingLevel() == 0) {
  - // Declare *any* scripting variables with NESTED scope
  - for (int i=0; ivarInfos.length; i++) {
  - if ((varInfos[i].getScope() == VariableInfo.NESTED)
  -  varInfos[i].getDeclare()) {
  - String name = varInfos[i].getVarName();
  - out.printin(varInfos[i].getClassName());
  - out.print( );
  - out.print(name);
  - out.println( = null;);
  - }
  - }
  - } else {
  - /*
  -  * Declare only scripting variable (with NESTED scope)
  -  * derived from unnested id attribute
  -  */
  - String idAttr = n.getAttributeValue(id);
  - for (int i=0; ivarInfos.length; i++) {
  - if ((varInfos[i].getScope() == VariableInfo.NESTED)
  -  varInfos[i].getDeclare()) {
  - String name = varInfos[i].getVarName();
  - if (idAttr.equals(name)) {
  - out.printin(varInfos[i].getClassName());
  - out.print( );
  - out.print(name);
  - out.println( = null;);
  - break;
  - }
  - }
  - }
  + if (nestedVarInfos != null) {
  + for (int i=0; inestedVarInfos.length; i++) {
  + String name = nestedVarInfos[i].getVarName();
  + out.printin(nestedVarInfos[i].getClassName());
  + out.print( );
  + out.print(name);
  + out.println( = null;);
}
} else {
for (int i=0; itagVarInfos.length; i++) {
  
  
  
  1.15.2.1  +50 -30
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
  retrieving revision 1.15.2.1
  diff -u -r1.15 -r1.15.2.1
  --- Node.java 21 Jun 2002 00:59:56 -  1.15
  +++ Node.java 18 Jul 2002 21:34:08 -  1.15.2.1
  @@ -673,8 +673,8 @@

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

2002-06-20 Thread kinman

kinman  2002/06/20 17:59:56

  Modified:jasper2/src/share/org/apache/jasper/compiler Generator.java
Node.java
  Log:
  - Fixed the last bug in nested tags costin discovered.  :-)
Patch supplied by Jan Luehe.
  
  Revision  ChangesPath
  1.32  +68 -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.31
  retrieving revision 1.32
  diff -u -r1.31 -r1.32
  --- Generator.java20 Jun 2002 20:12:26 -  1.31
  +++ Generator.java21 Jun 2002 00:59:56 -  1.32
  @@ -1471,14 +1471,21 @@
/*
 * Declares any NESTED scripting variables of the given custom tag,
 * if the given custom tag is not nested inside itself (i.e, has a
  -  * nesting level of zero). In addition, a NESTED scripting variable is 
  -  * declared only if it has not already been declared in the same scope
  -  * in the generated code, that is, if this custom tag's parent is
  +  * nesting level of zero). If the custom tag does have a custom nesting
  +  * level greater than 0, this method declares a scripting variable
  +  * derived from the tag's id attribute (if present), only if its
  +  * scope is NESTED and it does not match the id attribute of any of
  +  * the enclosing tags of the same (custom) type.
  +  *
  +  * Additionally, a NESTED scripting variable is declared only if it
  +  * has not already been declared in the same Java
  +  * scope of the generated code, that is, if this custom tag's parent is
 * different from the parent of the custom tag that may already have
 * declared this variable.
 */
private void declareNestedScriptingVariables(Node.CustomTag n) {
  - if (n.getCustomNestingLevel()  0) {
  +
  + if (n.getCustomNestingLevel()  0  !n.hasUnnestedIdAttribute()) {
return;
}
   
  @@ -1489,17 +1496,42 @@
}
   
if (varInfos != null) {
  - for (int i=0; ivarInfos.length; i++) {
  - if ((varInfos[i].getScope() == VariableInfo.NESTED)
  -  varInfos[i].getDeclare()) {
  - String name = varInfos[i].getVarName();
  - Node parent = (Node) nestedVars.get(name);
  - if ((parent == null) || (parent != n.getParent())) {
  - out.printin(varInfos[i].getClassName());
  - out.print( );
  - out.print(name);
  - out.println(;);
  - nestedVars.put(name, n.getParent());
  + if (n.getCustomNestingLevel() == 0) {
  + // Declare *any* scripting variables with NESTED scope
  + for (int i=0; ivarInfos.length; i++) {
  + if ((varInfos[i].getScope() == VariableInfo.NESTED)
  +  varInfos[i].getDeclare()) {
  + String name = varInfos[i].getVarName();
  + Node parent = (Node) nestedVars.get(name);
  + if (parent == null || parent != n.getParent()) {
  + out.printin(varInfos[i].getClassName());
  + out.print( );
  + out.print(name);
  + out.println(;);
  + nestedVars.put(name, n.getParent());
  + }
  + }
  + }
  + } else {
  + /*
  +  * Declare only scripting variable (with NESTED scope)
  +  * derived from unnested id attribute
  +  */
  + String idAttr = n.getAttributeValue(id);
  + for (int i=0; ivarInfos.length; i++) {
  + if ((varInfos[i].getScope() == VariableInfo.NESTED)
  +  varInfos[i].getDeclare()) {
  + String name = varInfos[i].getVarName();
  + Node parent = (Node) nestedVars.get(name);
  + if ((parent == null || parent != n.getParent())
  +  idAttr.equals(name)) {
  + out.printin(varInfos[i].getClassName());
  + out.print( );
  + out.print(name);
  + out.println( = null;);
  + nestedVars.put(name, n.getParent());
  + break;
  + }
}
}
}
  @@ -1526,10 +1558,12 

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

2002-04-19 Thread kinman

kinman  02/04/19 13:35:01

  Modified:jasper2  BUILDING.txt
   jasper2/src/share/org/apache/jasper/compiler Generator.java
Node.java PageInfo.java ParserController.java
Validator.java
  Log:
  - Implement errata_a per 
http://jcp.org/aboutJava/communityprocess/maintenance/jsr053/errata_1_2_a_20020321.html
  
  Revision  ChangesPath
  1.2   +8 -4  jakarta-tomcat-jasper/jasper2/BUILDING.txt
  
  Index: BUILDING.txt
  ===
  RCS file: /home/cvs/jakarta-tomcat-jasper/jasper2/BUILDING.txt,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- BUILDING.txt  28 Mar 2002 18:46:15 -  1.1
  +++ BUILDING.txt  19 Apr 2002 20:35:01 -  1.2
  @@ -1,9 +1,13 @@
  -1.  Build tomcat 4
  +1. Go to a tomcat 4.0/4.1 repository
   
   cd jakarta-tomcat-4.0
  -ant
   
  -2.  Build jasper2
  +2. Edit jakarta-tomcat-4.0/build.properties to include this line
  +
  +jasper.home=../jakarta-tomcat-jasper/jasper2
   
  -cd ../jakarta-tomcat-jasper/jasper2
  +3. Build tomcat 4
  +
  +ant clean
   ant
  +
  
  
  
  1.5   +6 -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.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- Generator.java11 Apr 2002 18:14:03 -  1.4
  +++ Generator.java19 Apr 2002 20:35:01 -  1.5
  @@ -1,7 +1,7 @@
   /*
  - * $Header: 
/home/cvs/jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/compiler/Generator.java,v
 1.4 2002/04/11 18:14:03 kinman Exp $
  - * $Revision: 1.4 $
  - * $Date: 2002/04/11 18:14:03 $
  + * $Header: 
/home/cvs/jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/compiler/Generator.java,v
 1.5 2002/04/19 20:35:01 kinman Exp $
  + * $Revision: 1.5 $
  + * $Date: 2002/04/19 20:35:01 $
*
* 
* 
  @@ -160,7 +160,6 @@
String servletPackageName = ctxt.getServletPackageName();
String servletClassName = ctxt.getServletClassName();
String serviceMethodName = Constants.SERVICE_METHOD_NAME;
  - String servletContentType = Constants.SERVLET_CONTENT_TYPE;
   
// First the package name:
   
  @@ -229,17 +228,9 @@
   
out.printil(_jspxFactory = JspFactory.getDefaultFactory(););
   
  - if (pageInfo.getContentType() != null) {
  - servletContentType = pageInfo.getContentType();
  - out.printin(response.setContentType();
  - out.print  (quote(servletContentType));
  - out.println(););
  - }
  - else {
  - out.printin(response.setContentType(\);
  - out.print  (servletContentType);
  - out.println(;charset=ISO-8859-1\););
  - }
  + out.printin(response.setContentType();
  + out.print  (quote(pageInfo.getContentType()));
  + out.println(););
   
out.printil(pageContext = _jspxFactory.getPageContext( +
this, request, response,);
  
  
  
  1.6   +4 -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.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- Node.java 5 Apr 2002 20:27:30 -   1.5
  +++ Node.java 19 Apr 2002 20:35:01 -  1.6
  @@ -1,7 +1,7 @@
   /*
  - * $Header: 
/home/cvs/jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/compiler/Node.java,v
 1.5 2002/04/05 20:27:30 kinman Exp $
  - * $Revision: 1.5 $
  - * $Date: 2002/04/05 20:27:30 $
  + * $Header: 
/home/cvs/jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/compiler/Node.java,v
 1.6 2002/04/19 20:35:01 kinman Exp $
  + * $Revision: 1.6 $
  + * $Date: 2002/04/19 20:35:01 $
*
* 
* 
  @@ -740,7 +740,7 @@
*/
   
   /**
  - * Represents attributes that can be runtime expressions.
  + * Represents attributes that can be request time expressions.
*/
   
   public static class JspAttribute {
  
  
  
  1.2   +12 -3 
jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/compiler/PageInfo.java
  
  Index: PageInfo.java
  ===
  RCS file: 
/home/cvs/jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/compiler/PageInfo.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- PageInfo.java 28 Mar 2002 

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

2002-04-05 Thread kinman

kinman  02/04/05 10:40:50

  Modified:jasper2/src/share/org/apache/jasper/compiler Generator.java
Node.java
  Log:
  - Fixed some typo and obvious bugs.
  - Reverted codes to init JspAttrs in Node.CustomTag: not the right place for it.
  
  Revision  ChangesPath
  1.3   +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.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- Generator.java28 Mar 2002 19:43:08 -  1.2
  +++ Generator.java5 Apr 2002 18:40:50 -   1.3
  @@ -1,7 +1,7 @@
   /*
  - * $Header: 
/home/cvs/jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/compiler/Generator.java,v
 1.2 2002/03/28 19:43:08 kinman Exp $
  - * $Revision: 1.2 $
  - * $Date: 2002/03/28 19:43:08 $
  + * $Header: 
/home/cvs/jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/compiler/Generator.java,v
 1.3 2002/04/05 18:40:50 kinman Exp $
  + * $Revision: 1.3 $
  + * $Date: 2002/04/05 18:40:50 $
*
* 
* 
  @@ -216,7 +216,7 @@
if (pageInfo.isSession())
out.printil(HttpSession session = null;);
   
  - if (ctxt.isErrorPage())
  + if (pageInfo.isIsErrorPage())
   out.printil(Throwable exception = (Throwable) 
request.getAttribute(\javax.servlet.jsp.jspException\););
   
out.printil(ServletContext application = null;);
  
  
  
  1.4   +6 -14 
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.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- Node.java 4 Apr 2002 11:32:05 -   1.3
  +++ Node.java 5 Apr 2002 18:40:50 -   1.4
  @@ -1,7 +1,7 @@
   /*
  - * $Header: 
/home/cvs/jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/compiler/Node.java,v
 1.3 2002/04/04 11:32:05 remm Exp $
  - * $Revision: 1.3 $
  - * $Date: 2002/04/04 11:32:05 $
  + * $Header: 
/home/cvs/jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/compiler/Node.java,v
 1.4 2002/04/05 18:40:50 kinman Exp $
  + * $Revision: 1.4 $
  + * $Date: 2002/04/05 18:40:50 $
*
* 
* 
  @@ -465,7 +465,7 @@
v.visit(this);
}
   
  - public void setValue(JspAttribute page) {
  + public void setValue(JspAttribute value) {
this.value = value;
}
   
  @@ -579,7 +579,7 @@
v.visit(this);
}
   
  - public void setValue(JspAttribute page) {
  + public void setValue(JspAttribute value) {
this.value = value;
}
   
  @@ -603,7 +603,7 @@
v.visit(this);
}
   
  - public void setBeanName(JspAttribute page) {
  + public void setBeanName(JspAttribute beanName) {
this.beanName = beanName;
}
   
  @@ -663,14 +663,6 @@
this.name = name;
this.prefix = prefix;
this.shortName = shortName;
  -jspAttrs = new JspAttribute[attrs.getLength()];
  -Hashtable attrsHashtable = new Hashtable();
  -for (int i = 0; i  attrs.getLength(); i++) {
  -jspAttrs[i] = new JspAttribute
  -(attrs.getLocalName(i), attrs.getValue(i), false);
  -attrsHashtable.put(attrs.getLocalName(i), attrs.getValue(i));
  -}
  -tagData = new TagData(attrsHashtable);
}
   
public void accept(Visitor v) throws JasperException {
  
  
  

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