larryi      00/11/05 20:08:15

  Modified:    src/share/org/apache/jasper/compiler Tag: tomcat_32
                        JspReader.java JspUtil.java Parser.java
               src/share/org/apache/jasper/resources Tag: tomcat_32
                        messages.properties messages_es.properties
  Log:
  Port Pierre Delisle's fix for the incredably unhelpful error message that occurs
  for unterminated user-defined tags.
  
  Revision  Changes    Path
  No                   revision
  
  
  No                   revision
  
  
  1.16.2.4  +5 -0      
jakarta-tomcat/src/share/org/apache/jasper/compiler/JspReader.java
  
  Index: JspReader.java
  ===================================================================
  RCS file: 
/home/cvs/jakarta-tomcat/src/share/org/apache/jasper/compiler/JspReader.java,v
  retrieving revision 1.16.2.3
  retrieving revision 1.16.2.4
  diff -u -r1.16.2.3 -r1.16.2.4
  --- JspReader.java    2000/08/28 02:48:05     1.16.2.3
  +++ JspReader.java    2000/11/06 04:08:14     1.16.2.4
  @@ -234,6 +234,11 @@
   
        // Restore parser state:
        //size--;
  +     if (currFileId < 0) {
  +         throw new ParseException(
  +                       Constants.getString("jsp.error.no.more.content"));
  +     }
  +
        String fName = getFile(currFileId);
        currFileId = unregisterSourceFile(fName);
        if (currFileId < -1)
  
  
  
  1.17.2.2  +27 -3     jakarta-tomcat/src/share/org/apache/jasper/compiler/JspUtil.java
  
  Index: JspUtil.java
  ===================================================================
  RCS file: 
/home/cvs/jakarta-tomcat/src/share/org/apache/jasper/compiler/JspUtil.java,v
  retrieving revision 1.17.2.1
  retrieving revision 1.17.2.2
  diff -u -r1.17.2.1 -r1.17.2.2
  --- JspUtil.java      2000/07/07 11:58:50     1.17.2.1
  +++ JspUtil.java      2000/11/06 04:08:14     1.17.2.2
  @@ -1,7 +1,7 @@
   /*
  - * $Header: 
/home/cvs/jakarta-tomcat/src/share/org/apache/jasper/compiler/JspUtil.java,v 1.17.2.1 
2000/07/07 11:58:50 rubys Exp $
  - * $Revision: 1.17.2.1 $
  - * $Date: 2000/07/07 11:58:50 $
  + * $Header: 
/home/cvs/jakarta-tomcat/src/share/org/apache/jasper/compiler/JspUtil.java,v 1.17.2.2 
2000/11/06 04:08:14 larryi Exp $
  + * $Revision: 1.17.2.2 $
  + * $Date: 2000/11/06 04:08:14 $
    *
    * ====================================================================
    * 
  @@ -264,6 +264,30 @@
        return escString;
       }
       
  +    /**
  +     *  Escape the 5 entities defined by XML.
  +     */
  +    public static String escapeXml(String s) {
  +        if (s == null) return null;
  +        StringBuffer sb = new StringBuffer();
  +        for(int i=0; i<s.length(); i++) {
  +            char c = s.charAt(i);
  +            if (c == '<') {
  +                sb.append("&lt;");
  +            } else if (c == '>') {
  +                sb.append("&gt;");
  +            } else if (c == '\'') {
  +                sb.append("&apos;");
  +            } else if (c == '&') {
  +                sb.append("&amp;");
  +            } else if (c == '"') {
  +                sb.append("&quote;");
  +            } else {
  +                sb.append(c);
  +            }
  +        }
  +        return sb.toString();
  +    }
   
       public static class ValidAttribute {
        String name;
  
  
  
  1.24.2.1  +8 -1      jakarta-tomcat/src/share/org/apache/jasper/compiler/Parser.java
  
  Index: Parser.java
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat/src/share/org/apache/jasper/compiler/Parser.java,v
  retrieving revision 1.24
  retrieving revision 1.24.2.1
  diff -u -r1.24 -r1.24.2.1
  --- Parser.java       2000/06/19 23:22:25     1.24
  +++ Parser.java       2000/11/06 04:08:14     1.24.2.1
  @@ -831,7 +831,14 @@
                               // Parse until the end of the tag body. 
                               // Then skip the tag end... 
                               parser.parse(tagEnd);
  -                            reader.advance(tagEnd.length());
  +                            try {
  +                                reader.advance(tagEnd.length());
  +                            } catch (ParseException ex) {
  +                                throw new ParseException(
  +                                    start,
  +                                    
Constants.getString("jsp.error.unterminated.user.tag", 
  +                                        new Object[]{JspUtil.escapeXml(tagEnd)}));
  +                         }
                            listener.setTemplateInfo(parser.tmplStart, 
parser.tmplStop);
                               listener.handleTagEnd(parser.tmplStop, reader.mark(), 
prefix, 
                                                     shortTagName, attrs, tli, ti);
  
  
  
  No                   revision
  
  
  No                   revision
  
  
  1.17.2.6  +4 -2      
jakarta-tomcat/src/share/org/apache/jasper/resources/messages.properties
  
  Index: messages.properties
  ===================================================================
  RCS file: 
/home/cvs/jakarta-tomcat/src/share/org/apache/jasper/resources/messages.properties,v
  retrieving revision 1.17.2.5
  retrieving revision 1.17.2.6
  diff -u -r1.17.2.5 -r1.17.2.6
  --- messages.properties       2000/07/26 16:06:51     1.17.2.5
  +++ messages.properties       2000/11/06 04:08:15     1.17.2.6
  @@ -1,4 +1,4 @@
  -# $Id: messages.properties,v 1.17.2.5 2000/07/26 16:06:51 shemnon Exp $
  +# $Id: messages.properties,v 1.17.2.6 2000/11/06 04:08:15 larryi Exp $
   #
   # Default localized string information
   # Localized this the Default Locale as is en_US
  @@ -208,4 +208,6 @@
   jspc.error.jasperException=error-the file ''{0}'' generated the following parse 
exception: {1}
   jspc.error.generalException=ERROR-the file ''{0}'' generated the following general 
exception: {1}
   jspc.error.fileDoesNotExist=The file argument ''{0}'' does not exist
  -jspc.error.emptyWebApp=-webapp requires a trailing file argument
  \ No newline at end of file
  +jspc.error.emptyWebApp=-webapp requires a trailing file argument
  +jsp.error.no.more.content=End of content reached while more parsing required: 
unterminated tag or tag nesting error?
  +jsp.error.unterminated.user.tag=Unterminated user-defined tag: ending tag {0} not 
found or incorrectly nested 
  
  
  
  1.3.2.5   +3 -1      
jakarta-tomcat/src/share/org/apache/jasper/resources/messages_es.properties
  
  Index: messages_es.properties
  ===================================================================
  RCS file: 
/home/cvs/jakarta-tomcat/src/share/org/apache/jasper/resources/messages_es.properties,v
  retrieving revision 1.3.2.4
  retrieving revision 1.3.2.5
  diff -u -r1.3.2.4 -r1.3.2.5
  --- messages_es.properties    2000/07/26 16:06:51     1.3.2.4
  +++ messages_es.properties    2000/11/06 04:08:15     1.3.2.5
  @@ -1,4 +1,4 @@
  -# $Id: messages_es.properties,v 1.3.2.4 2000/07/26 16:06:51 shemnon Exp $
  +# $Id: messages_es.properties,v 1.3.2.5 2000/11/06 04:08:15 larryi Exp $
   #
   # Default localized string information
   # Localized para Locale es_ES
  @@ -201,3 +201,5 @@
   jspc.error.generalException=ERROR-el archivo ''{0}'' ha generado la excepcion 
general siguiente: {1}
   jspc.error.fileDoesNotExist=El archivo ''{0}'' utilizado como argumento no existe.
   jspc.error.emptyWebApp=-webapp necesita un argumento de archivo
  +jsp.error.no.more.content=Final del contenido alcanzado mientras se requeria mas 
entrada: anidamiento de tag s erroneo o tag no terminado
  +jsp.error.unterminated.user.tag=Tag definida por el usuario no terminada: tag de 
finalizacion {0} no encontrado o incorrectamente anidado
  
  
  

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

Reply via email to