tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Anil K. Vijendran" <Anil.Vijend...@eng.sun.com>
Subject Re: Why was Jasper support for XML Scripting elements removed?
Date Fri, 21 Jan 2000 14:48:11 GMT
See Eduardo's mail on this topic (subject: use of xml syntax) on
tomcat-dev. The idea is mixing both non xml and xml equivalents was not
intended by the spec and that's exactly what the parser was doing --
allowing things to be intermixed. 

Hans, Eduardo, Danno +1ed it explicitly. Mine was a +1 too I think, can't
remember. 

On Fri, 21 Jan 2000 rubys@us.ibm.com wrote:

> 
> 
> Support for the items in section 7.4 of the spec appear to have been
> removed.  I don't recall any discussion of this - nor did I appear to get
> any CVS notification.  As far as I can tell, the support was present and
> working in the code, and remains in the spec - it simply was removed.
> 
> Why?
> 
> ----
> 
> date: 2000/01/14 04:34:38;  author: shemnon;  state: Exp;  lines: +8 -15
> Brings the XML handling in accordance with the spec, as clarified by
> edward/o.  Also the xml.jsp test has been transformed as per the spec
> (I think, up for review) and it has been removed from the tests since it
> likely will not be working in a main line branch w/in three months.
> 
> Index: Parser.java
> ===================================================================
> RCS file:
> /home/cvs/jakarta-tomcat/src/share/org/apache/jasper/compiler/Parser.java,v
> retrieving revision 1.11
> retrieving revision 1.12
> diff -u -r1.11 -r1.12
> --- Parser.java     1999/12/29 21:27:30  1.11
> +++ Parser.java     2000/01/14 04:34:38  1.12
> @@ -113,8 +113,6 @@
>      static final class Directive implements CoreElement {
>      private static final String OPEN_DIRECTIVE  = "<%@";
>      private static final String CLOSE_DIRECTIVE = "%>";
> -        private static final String OPEN_DIRECTIVE_2 = "<jsp:directive.";
> -    private static final String CLOSE_DIRECTIVE_2 = "/>";
> 
>      static final String[] directives = {
>        "page",
> @@ -154,9 +152,6 @@
>          if (reader.matches(OPEN_DIRECTIVE)) {
>           open = OPEN_DIRECTIVE;
>           close = CLOSE_DIRECTIVE;
> -        } else if (reader.matches(OPEN_DIRECTIVE_2)) {
> -         open = OPEN_DIRECTIVE_2;-           close = CLOSE_DIRECTIVE_2;
>          } else
>           return false;
> 
> @@ -419,10 +414,6 @@
>      private static final String OPEN_DECL  = "<%!";
>      private static final String CLOSE_DECL = "%>";
> 
> -    private static final String OPEN_DECL_2   = "<jsp:decl";
> -    private static final String END_OPEN_DECL_2 = ">";
> -    private static final String CLOSE_DECL_2 = "</jsp:decl>";
> -
>          private static final JspUtil.ValidAttribute[] validAttributes = {
>          };
> 
> @@ -432,11 +423,7 @@
>          String close, open, end_open = null;
>              Hashtable attrs = null;
> 
> -        if (reader.matches(OPEN_DECL_2)) {
> -         open = OPEN_DECL_2;
> -                end_open = END_OPEN_DECL_2;
> -         close = CLOSE_DECL_2;
> -        } else if (reader.matches(OPEN_DECL)) {
> +        if (reader.matches(OPEN_DECL)) {
>           open = OPEN_DECL;
>           close = CLOSE_DECL;
>          } else
> @@ -479,10 +466,6 @@
>      private static final String OPEN_EXPR  = "<%=";
>      private static final String CLOSE_EXPR = "%>";
> 
> -    private static final String OPEN_EXPR_2   = "<jsp:expression";
> -    private static final String END_OPEN_EXPR_2 = ">";
> -    private static final String CLOSE_EXPR_2 = "</jsp:expression>";
> -
>          private static final JspUtil.ValidAttribute[] validAttributes = {
>          };
> 
> @@ -492,11 +475,7 @@
>          String close, open, end_open=null;
>              Hashtable attrs = null;
> 
> -        if (reader.matches(OPEN_EXPR_2)) {
> -         open = OPEN_EXPR_2;
> -                end_open = END_OPEN_EXPR_2;
> -         close = CLOSE_EXPR_2;
> -        } else if (reader.matches(OPEN_EXPR)) {
> +        if (reader.matches(OPEN_EXPR)) {
>           open = OPEN_EXPR;
>           close = CLOSE_EXPR;
>          } else
> @@ -538,10 +517,6 @@
>      private static final String OPEN_SCRIPTLET  = "<%";
>      private static final String CLOSE_SCRIPTLET = "%>";
> 
> -    private static final String OPEN_SCRIPTLET_2  = "<jsp:scriptlet";
> -    private static final String END_OPEN_SCRIPTLET_2 = ">";
> -    private static final String CLOSE_SCRIPTLET_2 = "</jsp:scriptlet>";
> -
>          private static final JspUtil.ValidAttribute[] validAttributes = {
>          };
> 
> @@ -551,11 +526,7 @@
>          String close, open, end_open = null;
>              Hashtable attrs = null;
> 
> -        if (reader.matches(OPEN_SCRIPTLET_2)) {
> -         open = OPEN_SCRIPTLET_2;
> -                end_open = END_OPEN_SCRIPTLET_2;
> -         close = CLOSE_SCRIPTLET_2;
> -        } else if (reader.matches(OPEN_SCRIPTLET)) {
> +        if (reader.matches(OPEN_SCRIPTLET)) {
>           open = OPEN_SCRIPTLET;
>           close = CLOSE_SCRIPTLET;
>          } else
> 
> Index: JspUtil.java
> ===================================================================
> RCS file:
> /home/cvs/jakarta-tomcat/src/share/org/apache/jasper/compiler/JspUtil.java,v
> 
> retrieving revision 1.7
> retrieving revision 1.8
> diff -u -r1.7 -r1.8
> --- JspUtil.java    1999/12/24 12:57:17  1.7
> +++ JspUtil.java    2000/01/14 04:34:38  1.8
> @@ -1,7 +1,7 @@
>  /*
> - * $Header:
> /home/cvs/jakarta-tomcat/src/share/org/apache/jasper/compiler/JspUtil.java,v
> 
> 1.7 1999/12/24 12:57:17 rubys Exp $
> - * $Revision: 1.7 $
> - * $Date: 1999/12/24 12:57:17 $
> + * $Header:
> /home/cvs/jakarta-tomcat/src/share/org/apache/jasper/compiler/JspUtil.java,v
> 
> 1.8 2000/01/14 04:34:38 shemnon Exp $
> + * $Revision: 1.8 $
> + * $Date: 2000/01/14 04:34:38 $
>   *
>   * ====================================================================
>   *
> @@ -88,8 +88,6 @@
> 
>      private static final String OPEN_EXPR  = "<%=";
>      private static final String CLOSE_EXPR = "%>";
> -    private static final String OPEN_EXPR_2 = "%=";
> -    private static final String CLOSE_EXPR_2 = "%";
> 
>      public static char[] removeQuotes(char []chars) {
>      CharArrayWriter caw = new CharArrayWriter();
> @@ -108,11 +106,9 @@
>      // Checks if the token is a runtime expression.
>      public static boolean isExpression (String token) {
> 
> -    if (token.startsWith(OPEN_EXPR) && token.endsWith(CLOSE_EXPR))
> +    if (token.startsWith(OPEN_EXPR) && token.endsWith(CLOSE_EXPR)) {
>          return true;
> -
> -    if (token.startsWith(OPEN_EXPR_2) && token.endsWith(CLOSE_EXPR_2))
> -        return true;
> +    }
> 
>      return false;
>      }
> @@ -122,14 +118,11 @@
>      String returnString;
>      int length = expression.length();
> 
> -    if (expression.startsWith(OPEN_EXPR) &&
> expression.endsWith(CLOSE_EXPR))
> +    if (expression.startsWith(OPEN_EXPR) &&
> expression.endsWith(CLOSE_EXPR)) {
>          returnString = expression.substring (OPEN_EXPR.length(), length -
> CLOSE_EXPR.length());
> -
> -    else if (expression.startsWith(OPEN_EXPR_2) &&
> expression.endsWith(CLOSE_EXPR_2))
> -        returnString = expression.substring (OPEN_EXPR_2.length(), length
> - CLOSE_EXPR_2.length());
> -
> -    else
> +    } else {
>          returnString = "";
> +    }
> 
>      return returnString;
>      }
> 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tomcat-dev-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tomcat-dev-help@jakarta.apache.org
> 

--
Peace, Anil +<:-)



Mime
View raw message