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

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

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

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



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

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

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

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



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

2003-02-20 Thread luehe
luehe   2003/02/20 09:36:30

  Modified:jasper2/src/share/org/apache/jasper/compiler Node.java
  Log:
  set isDummy to true in zero-arg constructor
  
  Revision  ChangesPath
  1.60  +6 -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.59
  retrieving revision 1.60
  diff -u -r1.59 -r1.60
  --- Node.java 20 Feb 2003 02:14:18 -  1.59
  +++ Node.java 20 Feb 2003 17:36:29 -  1.60
  @@ -97,7 +97,9 @@
   /**
* Zero-arg Constructor.
*/
  -public Node() {}
  +public Node() {
  + this.isDummy = true;
  +}
   
   /**
* Constructor.
  
  
  

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




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

2003-02-19 Thread luehe
luehe   2003/02/19 18:14:19

  Modified:jasper2/src/share/org/apache/jasper/compiler Node.java
  Log:
  Added zero-arg constructor (needed by Node.Root)
  
  Revision  ChangesPath
  1.59  +8 -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.58
  retrieving revision 1.59
  diff -u -r1.58 -r1.59
  --- Node.java 20 Feb 2003 01:02:51 -  1.58
  +++ Node.java 20 Feb 2003 02:14:18 -  1.59
  @@ -95,6 +95,11 @@
   private boolean isDummy;
   
   /**
  + * Zero-arg Constructor.
  + */
  +public Node() {}
  +
  +/**
* Constructor.
* @param start The location of the jsp page
* @param parent The enclosing node
  
  
  

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




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

2003-02-13 Thread luehe
luehe   2003/02/13 15:25:05

  Modified:jasper2/src/share/org/apache/jasper/compiler Node.java
  Log:
  moved comment
  
  Revision  ChangesPath
  1.55  +8 -7  
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.54
  retrieving revision 1.55
  diff -u -r1.54 -r1.55
  --- Node.java 14 Jan 2003 22:32:58 -  1.54
  +++ Node.java 13 Feb 2003 23:25:05 -  1.55
  @@ -1410,6 +1410,11 @@
   return temporaryVariableName;
   }
   
  + /*
  +  * Get the attribute value from this named attribute (jsp:attribute).
  +  * Since this method is only for attributes that are not rtexpr,
  +  * we can assume the body of the jsp:attribute is a template text.
  +  */
public String getText() {
   
class AttributeVisitor extends Visitor {
  @@ -1423,10 +1428,6 @@
}
}
   
  - // Get the attribute value from this named attribute
  - // (jsp:attribute).
  - // Since this method is only for attributes that are not rtexpr,
  - // we can assume the body of the jsp:attribute is a template text.
// According to JSP 2.0, if the body of the jsp:attribute
// action is empty, it is equivalent of specifying  as the value
// of the attribute.
  
  
  

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




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

2003-01-14 Thread luehe
luehe   2003/01/14 14:32:59

  Modified:jasper2/src/share/org/apache/jasper/compiler Node.java
Validator.java
  Log:
  Fixed 16077: Invalid error generated when translating a valid JSP document
  
  Revision  ChangesPath
  1.54  +6 -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.53
  retrieving revision 1.54
  diff -u -r1.53 -r1.54
  --- Node.java 11 Jan 2003 00:52:14 -  1.53
  +++ Node.java 14 Jan 2003 22:32:58 -  1.54
  @@ -195,6 +195,9 @@
   /**
* Searches all subnodes of this node for jsp:attribute standard
* actions, and returns that set of nodes as a Node.Nodes object.
  + *
  + * @return Possibly empty Node.Nodes object containing any jsp:attribute
  + * subnodes of this Node
*/
   public Node.Nodes getNamedAttributeNodes() {
   
  
  
  
  1.66  +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.65
  retrieving revision 1.66
  diff -u -r1.65 -r1.66
  --- Validator.java8 Jan 2003 18:42:43 -   1.65
  +++ Validator.java14 Jan 2003 22:32:58 -  1.66
  @@ -657,7 +657,7 @@
   }
   
public void visit(Node.UninterpretedTag n) throws JasperException {
  -if (n.getNamedAttributeNodes() != null) {
  +if (n.getNamedAttributeNodes().size() != 0) {
err.jspError(n, jsp.error.namedAttribute.invalidUse);
   }
   }
  
  
  

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

2002-12-13 Thread luehe
luehe   2002/12/13 10:06:08

  Modified:jasper2/src/share/org/apache/jasper/compiler Node.java
Validator.java
  Log:
  Implemented JSP 2.0 clarification for TagData.getAttribute() regarding
  named attributes:
  
 If a static value is specified for an attribute that accepts a
 request-time attribute expression then that static value is returned,
 even if the value is provided in the body of a jsp:attribute action.
 The distinguished object REQUEST_TIME_VALUE is only returned if
 the value is specified as a request-time attribute expression
 or via the jsp:attribute with a body that contains dynamic content
 (scriptlets, scripting expressions, EL expressions, standard actions,
 or custom actions).  Returns null if the attribute is not set.
  
  Revision  ChangesPath
  1.48  +39 -31
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.47
  retrieving revision 1.48
  diff -u -r1.47 -r1.48
  --- Node.java 12 Dec 2002 03:30:58 -  1.47
  +++ Node.java 13 Dec 2002 18:06:08 -  1.48
  @@ -145,16 +145,6 @@
* from the attribute of the node, or from a jsp:attrbute 
*/
   public String getTextAttribute(String name) {
  - class AttributeVisitor extends Visitor {
  - String attrValue = null;
  - public void visit(TemplateText txt) {
  - attrValue = new String(txt.getText());
  - }
  -
  - public String getAttrValue() {
  - return attrValue;
  - }
  - }
   
String attr = getAttributeValue(name);
if (attr != null) {
  @@ -166,19 +156,7 @@
return null;
}
   
  - // Get the attribute value from named attribute (jsp:attribute)
  - // Since this method is only for attributes that are not rtexpr,
  - // we can assume the body of the jsp:attribute is a template text
  - if (namedAttribute.getBody() != null) {
  - AttributeVisitor attributeVisitor = new AttributeVisitor();
  - try {
  - namedAttribute.getBody().visit(attributeVisitor);
  - } catch (JasperException e) {
  - }
  - attr = attributeVisitor.getAttrValue();
  - }
  -
  - return attr;
  + return namedAttribute.getText();
   }
   
   /**
  @@ -922,7 +900,7 @@
*/
   public static class ChildInfo {
private boolean scriptless; // true if the tag and its body
  - // contians no scripting elements.
  + // contain no scripting elements.
private boolean hasUseBean;
private boolean hasIncludeAction;
private boolean hasSetProperty;
  @@ -1368,6 +1346,36 @@
   public String getTemporaryVariableName() {
   return temporaryVariableName;
   }
  +
  + public String getText() {
  +
  + class AttributeVisitor extends Visitor {
  + String attrValue = null;
  + public void visit(TemplateText txt) {
  + attrValue = new String(txt.getText());
  + }
  + 
  + public String getAttrValue() {
  + return attrValue;
  + }
  + }
  +
  + // Get the attribute value from this named attribute
  + // (jsp:attribute).
  + // Since this method is only for attributes that are not rtexpr,
  + // we can assume the body of the jsp:attribute is a template text
  + String text = null;
  + if (getBody() != null) {
  + AttributeVisitor attributeVisitor = new AttributeVisitor();
  + try {
  + getBody().visit(attributeVisitor);
  + } catch (JasperException e) {
  + }
  + text = attributeVisitor.getAttrValue();
  + }
  + 
  + return text;
  + }
   }
   
   /**
  @@ -1557,14 +1565,14 @@
* @return true if the value represents an expression that should
* be fed to the expression interpreter
* @return false for string literals or rtexprvalues that should
  - * not be interpreter or reevaluated
  + * not be interpreted or reevaluated
*/
   public boolean isELInterpreterInput() {
   return el;
   }
   
/**
  -  * @return true if the value is a string literal know at translation
  +  * @return true if the value is a string literal known at translation
 * time.
 */
public boolean isLiteral() {
  @@ -1654,8 +1662,8 @@
   public static class Visitor {
   
/**
  -  * The method provides a place to put actions that are 

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

2002-11-06 Thread luehe
luehe   2002/11/06 15:43:51

  Modified:jasper2/src/share/org/apache/jasper/compiler Tag:
tomcat_4_branch Node.java
  Log:
  Fixed 13963: Incompatible Javadoc Comments in org/apache/jasper/compiler/Node.java
  
  Revision  ChangesPath
  No   revision
  
  
  No   revision
  
  
  1.15.2.4  +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.15.2.3
  retrieving revision 1.15.2.4
  diff -u -r1.15.2.3 -r1.15.2.4
  --- Node.java 10 Sep 2002 00:36:23 -  1.15.2.3
  +++ Node.java 6 Nov 2002 23:43:51 -   1.15.2.4
   -237,7 +237,7 
}
   
/**
  -  *  return The enclosing root to this root.  Usually represents the
  +  * return The enclosing root to this root.  Usually represents the
 * page that includes this one.
 */
public Root getParentRoot() {
  
  
  

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

2002-08-16 Thread luehe

luehe   2002/08/16 17:15:28

  Modified:jasper2/src/share/org/apache/jasper/compiler Node.java
  Log:
  removed redundant field
  
  Revision  ChangesPath
  1.26  +3 -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.25
  retrieving revision 1.26
  diff -u -r1.25 -r1.26
  --- Node.java 16 Aug 2002 23:18:54 -  1.25
  +++ Node.java 17 Aug 2002 00:15:27 -  1.26
  @@ -889,7 +889,6 @@
private TagFileInfo tagFileInfo;
private Class tagHandlerClass;
private VariableInfo[] varInfos;
  - private TagVariableInfo[] nestedTagVarInfos;
private int customNestingLevel;
   private ChildInfo childInfo;
private boolean implementsIterationTag;
  
  
  

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

2002-07-24 Thread luehe

luehe   2002/07/24 15:00:11

  Modified:jasper2/src/share/org/apache/jasper/compiler Node.java
  Log:
  Added node types for jsp:invoke and jsp:doBody actions
  
  Revision  ChangesPath
  1.21  +41 -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.20
  retrieving revision 1.21
  diff -u -r1.20 -r1.21
  --- Node.java 22 Jul 2002 20:35:27 -  1.20
  +++ Node.java 24 Jul 2002 22:00:10 -  1.21
  @@ -445,6 +445,34 @@
   }
   
   /**
  + * Represents a jsp:invoke tag file action
  + */
  +public static class InvokeAction extends Node {
  +
  + public InvokeAction(Attributes attrs, Mark start, Node parent) {
  + super(attrs, start, parent);
  + }
  +
  + public void accept(Visitor v) throws JasperException {
  + v.visit(this);
  + }
  +}
  +
  +/**
  + * Represents a jsp:doBody tag file action
  + */
  +public static class DoBodyAction extends Node {
  +
  + public DoBodyAction(Attributes attrs, Mark start, Node parent) {
  + super(attrs, start, parent);
  + }
  +
  + public void accept(Visitor v) throws JasperException {
  + v.visit(this);
  + }
  +}
  +
  +/**
* Represents a Jsp comment
* Comments are kept for completeness.
*/
  @@ -1592,6 +1620,16 @@
   }
   
   public void visit(JspBody n) throws JasperException {
  +doVisit(n);
  +visitBody(n);
  +}
  +
  +public void visit(InvokeAction n) throws JasperException {
  +doVisit(n);
  +visitBody(n);
  +}
  +
  +public void visit(DoBodyAction n) throws JasperException {
   doVisit(n);
   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 Node.java

2002-06-05 Thread kinman

kinman  2002/06/05 16:29:53

  Modified:jasper2/src/share/org/apache/jasper/compiler Node.java
  Log:
  - Modified so it can be build with a modern javac.
  
  Revision  ChangesPath
  1.11  +9 -9  
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.10
  retrieving revision 1.11
  diff -u -r1.10 -r1.11
  --- Node.java 5 Jun 2002 22:01:33 -   1.10
  +++ Node.java 5 Jun 2002 23:29:53 -   1.11
  @@ -1,7 +1,7 @@
   /*
  - * $Header: 
/home/cvs/jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/compiler/Node.java,v
 1.10 2002/06/05 22:01:33 kinman Exp $
  - * $Revision: 1.10 $
  - * $Date: 2002/06/05 22:01:33 $
  + * $Header: 
/home/cvs/jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/compiler/Node.java,v
 1.11 2002/06/05 23:29:53 kinman Exp $
  + * $Revision: 1.11 $
  + * $Date: 2002/06/05 23:29:53 $
*
* 
* 
  @@ -76,12 +76,12 @@
   
   public abstract class Node {
   
  -private Attributes attrs;
  -private Nodes body;
  -private char[] text;
  -private Mark startMark;
  -private int beginJavaLine;
  -private int endJavaLine;
  +protected Attributes attrs;
  +protected Nodes body;
  +protected char[] text;
  +protected Mark startMark;
  +protected int beginJavaLine;
  +protected int endJavaLine;
   protected Node parent;
   
   /**
  
  
  

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

2002-05-23 Thread kinman

kinman  02/05/23 14:29:38

  Modified:jasper2/src/share/org/apache/jasper/compiler Node.java
Validator.java
  Log:
  - Set the default content type only after all page directives are processed.
Also, the top level page sets the default, i.e. if a non-xml page includes
a xml page, the default content type is text/html and not text/xml.
  
  Revision  ChangesPath
  1.9   +5 -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.8
  retrieving revision 1.9
  diff -u -r1.8 -r1.9
  --- Node.java 15 May 2002 20:42:03 -  1.8
  +++ Node.java 23 May 2002 21:29:38 -  1.9
  @@ -1,7 +1,7 @@
   /*
  - * $Header: 
/home/cvs/jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/compiler/Node.java,v
 1.8 2002/05/15 20:42:03 kinman Exp $
  - * $Revision: 1.8 $
  - * $Date: 2002/05/15 20:42:03 $
  + * $Header: 
/home/cvs/jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/compiler/Node.java,v
 1.9 2002/05/23 21:29:38 kinman Exp $
  + * $Revision: 1.9 $
  + * $Date: 2002/05/23 21:29:38 $
*
* 
* 
  @@ -793,7 +793,7 @@
   public static class Nodes {
   
private List list;
  - private Node.Root root;
  + private Node.Root root; // null if this is not a page
   
public Nodes() {
list = new Vector();
  @@ -811,6 +811,7 @@
 */
public void add(Node n) {
list.add(n);
  + root = null;
}
   
/**
  
  
  
  1.8   +15 -13
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.7
  retrieving revision 1.8
  diff -u -r1.7 -r1.8
  --- Validator.java18 May 2002 00:29:24 -  1.7
  +++ Validator.java23 May 2002 21:29:38 -  1.8
  @@ -1,7 +1,7 @@
   /*
  - * $Header: 
/home/cvs/jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/compiler/Validator.java,v
 1.7 2002/05/18 00:29:24 kinman Exp $
  - * $Revision: 1.7 $
  - * $Date: 2002/05/18 00:29:24 $
  + * $Header: 
/home/cvs/jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/compiler/Validator.java,v
 1.8 2002/05/23 21:29:38 kinman Exp $
  + * $Revision: 1.8 $
  + * $Date: 2002/05/23 21:29:38 $
*
* 
* 
  @@ -244,16 +244,6 @@
// Attributes for imports for this node have been processed by
// the parsers, just add them to pageInfo.
pageInfo.addImports(n.getImports());
  -
  - // Determine the output context type, per errata_a
  - // 
http://jcp.org/aboutJava/communityprocess/maintenance/jsr053/errata_1_2_a_20020321.html
  - if (pageInfo.getContentType() == null) {
  - String defaultType = n.isXmlSyntax()? text/xml;: text/html;;
  - String charset = pageInfo.getPageEncoding();
  - if (charset == null)
  - charset = n.isXmlSyntax()? UTF-8: ISO-8859-1;
  - pageInfo.setContentType(defaultType + charset);
  - }
}
   }
   
  @@ -613,6 +603,18 @@
 * and are position independent.
 */
page.visit(new PageDirectiveVisitor(compiler));
  +
  + // Determine the default output content type, per errata_a
  + // 
http://jcp.org/aboutJava/communityprocess/maintenance/jsr053/errata_1_2_a_20020321.html
  + PageInfo pageInfo = compiler.getPageInfo();
  + if (pageInfo.getContentType() == null) {
  + boolean isXml = page.getRoot().isXmlSyntax();
  + String defaultType = isXml? text/xml;: text/html;;
  + String charset = pageInfo.getPageEncoding();
  + if (charset == null)
  + charset = isXml? UTF-8: ISO-8859-1;
  + pageInfo.setContentType(defaultType + charset);
  + }
   
/*
 * Validate all other nodes.
  
  
  

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

2002-04-24 Thread kinman

kinman  02/04/24 14:12:53

  Modified:jasper2/src/share/org/apache/jasper/compiler Node.java
PageDataImpl.java
  Log:
  - Removed the static field in Node.java, because it is not thread safe.
Instead rely on traversing the nodes to find the page root.
  
  Revision  ChangesPath
  1.7   +20 -35
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.6
  retrieving revision 1.7
  diff -u -r1.6 -r1.7
  --- Node.java 19 Apr 2002 20:35:01 -  1.6
  +++ Node.java 24 Apr 2002 21:12:52 -  1.7
  @@ -1,7 +1,7 @@
   /*
  - * $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 $
  + * $Header: 
/home/cvs/jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/compiler/Node.java,v
 1.7 2002/04/24 21:12:52 kinman Exp $
  + * $Revision: 1.7 $
  + * $Date: 2002/04/24 21:12:52 $
*
* 
* 
  @@ -85,11 +85,6 @@
   protected Node parent;
   
   /**
  - * The root node of this page.
  - */
  -private static Root currentRoot;
  -
  -/**
* Constructor.
* @param start The location of the jsp page
* @param parent The enclosing node
  @@ -155,10 +150,6 @@
return parent;
   }
   
  -public Node getCurrentRoot() {
  - return currentRoot;
  -}
  -
   public int getBeginJavaLine() {
return beginJavaLine;
   }
  @@ -176,25 +167,17 @@
   }
   
   /**
  - * Warning: This method is valid only when used from the correct context,
  - * namely when the Root node for the current page has been visited first,
  - * and the proper bookkeeping (ttpushCurrentRoot/popCurrentRoot/tt)
  - * has been performed.
  - *
* @return true if the current page is in xml syntax, false otherwise.
*/
   public boolean isXmlSyntax() {
  - return currentRoot.isXmlSyntax();
  -}
  -
  -public static void pushCurrentRoot(Root root) {
  - root.setParentRoot(currentRoot);
  - currentRoot = root;
  -}
  + Node r = this;
  + while (!(r instanceof Node.Root)) {
  + r = r.getParent();
  + if (r == null)
  + return false;
  + }
   
  -public static Root popCurrentRoot() {
  - currentRoot = currentRoot.getParentRoot();
  - return currentRoot;
  + return r.isXmlSyntax();
   }
   
   /**
  @@ -237,6 +220,12 @@
   
Root(Attributes attrs, Mark start, Node parent) {
super(attrs, start, parent);
  +
  + // Figure out and set the parent root
  + Node r = parent;
  + while ((r != null)  !(r instanceof Node.Root))
  + r = r.getParent();
  + parentRoot = (Node.Root) r;
}
   
public void accept(Visitor v) throws JasperException {
  @@ -247,13 +236,13 @@
return false;
}
   
  + /**
  +  * @ return The enclosing root to this root.  Usually represents the
  +  * page that includes this one.
  +  */
public Root getParentRoot() {
return parentRoot;
}
  -
  - public void setParentRoot(Root root) {
  - parentRoot = root;
  - }
   }
   
   /**
  @@ -860,17 +849,13 @@
}
   
public void visit(Root n) throws JasperException {
  - Node.pushCurrentRoot(n);
doVisit(n);
visitBody(n);
  - Node.popCurrentRoot();
}
   
public void visit(JspRoot n) throws JasperException {
  - Node.pushCurrentRoot(n);
doVisit(n);
visitBody(n);
  - Node.popCurrentRoot();
}
   
public void visit(PageDirective n) throws JasperException {
  
  
  
  1.2   +4 -9  
jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/compiler/PageDataImpl.java
  
  Index: PageDataImpl.java
  ===
  RCS file: 
/home/cvs/jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/compiler/PageDataImpl.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- PageDataImpl.java 28 Mar 2002 18:46:16 -  1.1
  +++ PageDataImpl.java 24 Apr 2002 21:12:52 -  1.2
  @@ -1,7 +1,7 @@
   /*
  - * $Header: 
/home/cvs/jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/compiler/PageDataImpl.java,v
 1.1 2002/03/28 18:46:16 kinman Exp $
  - * $Revision: 1.1 $
  - * $Date: 2002/03/28 18:46:16 $
  + * $Header: 
/home/cvs/jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/compiler/PageDataImpl.java,v
 1.2 

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

2002-04-05 Thread kinman

kinman  02/04/05 12:27:30

  Modified:jasper2/src/share/org/apache/jasper/compiler Node.java
  Log:
  - Add visitBody to visit(JspText) for the default visitor, because
jsp:text has a body.
  
  Revision  ChangesPath
  1.5   +4 -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.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- Node.java 5 Apr 2002 18:40:50 -   1.4
  +++ Node.java 5 Apr 2002 20:27:30 -   1.5
  @@ -1,7 +1,7 @@
   /*
  - * $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 $
  + * $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 $
*
* 
* 
  @@ -956,6 +956,7 @@
   
public void visit(JspText n) throws JasperException {
doVisit(n);
  + visitBody(n);
}
   
public void visit(TemplateText n) throws JasperException {
  
  
  

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




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

2002-04-04 Thread remm

remm02/04/03 23:03:54

  Modified:jasper2/src/share/org/apache/jasper/compiler Node.java
  Log:
  - Fix NPE caused by JSP attributes field not being populated.
  
  Revision  ChangesPath
  1.2   +8 -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.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- Node.java 28 Mar 2002 18:46:16 -  1.1
  +++ Node.java 4 Apr 2002 07:03:54 -   1.2
  @@ -1,7 +1,7 @@
   /*
  - * $Header: 
/home/cvs/jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/compiler/Node.java,v
 1.1 2002/03/28 18:46:16 kinman Exp $
  - * $Revision: 1.1 $
  - * $Date: 2002/03/28 18:46:16 $
  + * $Header: 
/home/cvs/jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/compiler/Node.java,v
 1.2 2002/04/04 07:03:54 remm Exp $
  + * $Revision: 1.2 $
  + * $Date: 2002/04/04 07:03:54 $
*
* 
* 
  @@ -663,6 +663,11 @@
this.name = name;
this.prefix = prefix;
this.shortName = shortName;
  +jspAttrs = new JspAttribute[attrs.getLength()];
  +for (int i = 0; i  attrs.getLength(); i++) {
  +jspAttrs[i] = new JspAttribute
  +(attrs.getLocalName(i), attrs.getValue(i), false);
  +}
}
   
public void accept(Visitor v) throws JasperException {
  
  
  

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




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

2002-04-04 Thread remm

remm02/04/04 03:32:05

  Modified:jasper2/src/share/org/apache/jasper/compiler Node.java
  Log:
  - Also populate the TagData object.
  
  Revision  ChangesPath
  1.3   +6 -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.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- Node.java 4 Apr 2002 07:03:54 -   1.2
  +++ Node.java 4 Apr 2002 11:32:05 -   1.3
  @@ -1,7 +1,7 @@
   /*
  - * $Header: 
/home/cvs/jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/compiler/Node.java,v
 1.2 2002/04/04 07:03:54 remm Exp $
  - * $Revision: 1.2 $
  - * $Date: 2002/04/04 07:03:54 $
  + * $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 $
*
* 
* 
  @@ -664,10 +664,13 @@
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]




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

2002-04-04 Thread Remy Maucherat

 Remy,

 I afraid that this patch won't work, because you are initializing
 CustomTag.JspAttrs in the constructor, which is too early.
 CustomTag.JspAttrs is currently set in Validator, after tld is consulted
 to see if the tag attribute can take a request time expression;
 and if so, extracts the string between '%=' and '%' etc.

The patch is super easy to revert. My problem is that I don't understand
anything to the new generator design, so the patch is bad.

 Do you have a test case that causes a NPE?

Just try to run the admin webapp (and click on some tree node; there are
also some other small issues with the user admin pages).

Remy


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