luehe 2002/11/08 11:42:56
Modified: jasper2/src/share/org/apache/jasper/compiler Generator.java
JspDocumentParser.java Node.java Parser.java
Validator.java
jasper2/src/share/org/apache/jasper/resources
messages.properties messages_es.properties
messages_fr.properties messages_ja.properties
Log:
Made enumeration of ValidationMessage[] returned by TLV's validate()
method more robust by also considering the case where a
ValidationMessage element might be null.
Revision Changes Path
1.123 +5 -57
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.122
retrieving revision 1.123
diff -u -r1.122 -r1.123
--- Generator.java 7 Nov 2002 19:09:03 -0000 1.122
+++ Generator.java 8 Nov 2002 19:42:55 -0000 1.123
@@ -1766,65 +1766,13 @@
}
public void visit(Node.JspBody n) throws JasperException {
- Node.JspAttribute value = n.getValue();
if (isSimpleTagHandler) {
out.printin(simpleTagHandlerVar);
out.print(".setJspBody(");
-
- if (value != null) {
- out.print(attributeValue(value, false, JspFragment.class,
- "null" ));
- } else {
- generateJspFragment(n, simpleTagHandlerVar);
- }
+ generateJspFragment(n, simpleTagHandlerVar);
out.println(");");
} else {
- Node parent = n.getParent();
- if( (parent instanceof Node.CustomTag) && (value != null) ) {
- Node.CustomTag customTag = (Node.CustomTag)parent;
-
- // Classic tag handler invoked with <jsp:body value="...">
- // Generate a tag body that evaluates the given
- // fragment.
-
- // First, generate a Map with all the AT_BEGIN and
- // NESTED variables so the body can access them.
- VariableInfo[] varInfos = customTag.getVariableInfos();
- TagVariableInfo[] tagVarInfos =
- customTag.getTagVariableInfos();
-
- String var = JspUtil.nextTemporaryVariableName();
- out.printil( "java.util.HashMap " + var +
- " = new java.util.HashMap();" );
-
- for (int i = 0; i < varInfos.length; i++) {
- if ((varInfos[i].getScope() == VariableInfo.AT_BEGIN)
- || (varInfos[i].getScope() == VariableInfo.NESTED)) {
- out.printil( var + ".put( \"" +
- varInfos[i].getVarName() + "\", " +
- varInfos[i].getVarName() + " );" );
- }
- }
-
- for (int i = 0; i < tagVarInfos.length; i++) {
- if ((tagVarInfos[i].getScope() == VariableInfo.AT_BEGIN)
- || (tagVarInfos[i].getScope() == VariableInfo.NESTED))
{
- out.printin( var + ".put( \"" );
- String name = tagVarInfos[i].getNameGiven();
- if( name == null ) {
- name = customTag.getTagData().getAttributeString(
- tagVarInfos[i].getNameFromAttribute());
- }
- out.println( name + "\", " + name + " );" );
- }
- }
-
- out.printil("(" +
- attributeValue(value, false, JspFragment.class,
- "null" ) + ").invoke( out, " + var + " );" );
- } else {
- visitBody(n);
- }
+ visitBody(n);
}
}
1.27 +4 -4
jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/compiler/JspDocumentParser.java
Index: JspDocumentParser.java
===================================================================
RCS file:
/home/cvs/jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/compiler/JspDocumentParser.java,v
retrieving revision 1.26
retrieving revision 1.27
diff -u -r1.26 -r1.27
--- JspDocumentParser.java 8 Nov 2002 03:03:01 -0000 1.26
+++ JspDocumentParser.java 8 Nov 2002 19:42:55 -0000 1.27
@@ -274,7 +274,7 @@
} else if (qName.equals(JSP_TEXT)) {
node = new Node.JspText(start, current);
} else if (qName.equals(JSP_BODY)) {
- node = new Node.JspBody(attrsCopy, start, current);
+ node = new Node.JspBody(start, current);
} else if (qName.equals(JSP_ATTRIBUTE)) {
node = new Node.NamedAttribute(attrsCopy, start, current);
} else if (qName.equals(JSP_TAG_DIRECTIVE)) {
1.38 +5 -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.37
retrieving revision 1.38
diff -u -r1.37 -r1.38
--- Node.java 30 Oct 2002 17:41:22 -0000 1.37
+++ Node.java 8 Nov 2002 19:42:55 -0000 1.38
@@ -1304,11 +1304,10 @@
*/
public static class JspBody extends Node {
- private JspAttribute value;
private ChildInfo childInfo;
- public JspBody( Attributes attrs, Mark start, Node parent) {
- super( attrs, start, parent );
+ public JspBody(Mark start, Node parent) {
+ super(start, parent);
this.childInfo = new ChildInfo();
}
@@ -1316,14 +1315,6 @@
v.visit(this);
}
- public void setValue(JspAttribute value) {
- this.value = value;
- }
-
- public JspAttribute getValue() {
- return value;
- }
-
public ChildInfo getChildInfo() {
return childInfo;
}
1.38 +16 -27
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.37
retrieving revision 1.38
diff -u -r1.37 -r1.38
--- Parser.java 30 Oct 2002 17:41:22 -0000 1.37
+++ Parser.java 8 Nov 2002 19:42:55 -0000 1.38
@@ -1571,31 +1571,20 @@
Mark start = reader.mark();
reader.skipSpaces();
- if( reader.matches( ">" ) ) {
- Node bodyNode = new Node.JspBody( null, start, parent );
- if( reader.matches( "</jsp:body>" ) ) {
- // Body was empty. This is illegal, according to the grammar.
- err.jspError(reader.mark(),
- "jsp.error.empty.body.not.allowed",
- "<jsp:body>" );
- }
- else {
- parseBody( bodyNode, "jsp:body", bodyType );
- }
- }
- else {
- Attributes attrs = parseAttributes();
- reader.skipSpaces();
- new Node.JspBody( attrs, start, parent );
+ if (!reader.matches(">")) {
+ err.jspError(reader.mark(),
+ "jsp.error.attributes.not.allowed",
+ "<jsp:body>" );
+ }
- if( !reader.matches( "/>" ) &&
- !reader.matches( "></jsp:body>" ) )
- {
- err.jspError(reader.mark(),
- "jsp.error.jspbody.body.not.allowed.with.value",
- "<jsp:body>" );
- }
- }
+ Node bodyNode = new Node.JspBody(start, parent);
+ if( reader.matches( "</jsp:body>" ) ) {
+ // Body was empty. This is illegal, according to the grammar.
+ err.jspError(reader.mark(),"jsp.error.empty.body.not.allowed",
+ "<jsp:body>" );
+ } else {
+ parseBody( bodyNode, "jsp:body", bodyType );
+ }
}
/*
1.54 +3 -19
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.53
retrieving revision 1.54
diff -u -r1.53 -r1.54
--- Validator.java 8 Nov 2002 00:55:45 -0000 1.53
+++ Validator.java 8 Nov 2002 19:42:55 -0000 1.54
@@ -423,9 +423,6 @@
new JspUtil.ValidAttribute("name", true),
new JspUtil.ValidAttribute("trim") };
- private static final JspUtil.ValidAttribute[] bodyAttrs = {
- new JspUtil.ValidAttribute("value") };
-
private static final JspUtil.ValidAttribute[] invokeAttrs = {
new JspUtil.ValidAttribute("fragment", true),
new JspUtil.ValidAttribute("var"),
@@ -596,19 +593,6 @@
}
public void visit(Node.JspBody n) throws JasperException {
- String defaultPrefix = null;
- JspUtil.checkAttributes("Body", n,
- bodyAttrs, err);
- Node parent = n.getParent();
- if( parent instanceof Node.CustomTag ) {
- // Default prefix comes from parent custom tag's prefix.
- Node.CustomTag customTag = (Node.CustomTag)parent;
- defaultPrefix = customTag.getPrefix();
- }
- n.setValue(getJspAttribute("value", null, null,
- n.getAttributeValue("value"),
- JspFragment.class, defaultPrefix,
- n, false));
visitBody(n);
}
1.57 +2 -9
jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/resources/messages.properties
Index: messages.properties
===================================================================
RCS file:
/home/cvs/jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/resources/messages.properties,v
retrieving revision 1.56
retrieving revision 1.57
diff -u -r1.56 -r1.57
--- messages.properties 7 Nov 2002 22:19:13 -0000 1.56
+++ messages.properties 8 Nov 2002 19:42:56 -0000 1.57
@@ -262,23 +262,15 @@
jsp.error.single.line.number=\n\nAn error occurred at line: {0} in the jsp file:
{1}\n\n
jsp.error.multiple.line.number=\n\nAn error occurred between lines: {0} and {1} in
the jsp file: {2}\n\n
jsp.error.corresponding.servlet=Generated servlet error:\n
-
jsp.error.empty.body.not.allowed=Empty body not allowed for {0}
-jsp.error.jspbody.body.not.allowed.with.value=Body not allowed for jsp:body if any
attributes (such as value) are specified.
-
jsp.error.jspbody.required=Must use jsp:body to specify tag body for {0} if
jsp:attribute is used.
-
jsp.error.jspbody.emptybody.only=The {0} tag can only have jsp:attribute in its
body.
-
jsp.error.no.scriptlets=Scripting elements ( <%@, <%!, <%=, <% ) are disallowed
here.
-
jsp.error.internal.unexpected_node_type=Internal Error: Unexpected node type
encountered
-
jsp.error.tld.fn.invalid.signature=Invalid syntax for function signature in TLD.
Tag Library: {0}, Function: {1}
jsp.error.tld.fn.invalid.signature.classnotfound=Invalid syntax for function
signature in TLD. Class not found: ${0}. Tag Library: {1}, Function: {2}.
jsp.error.tld.fn.invalid.signature.commaexpected=Invalid syntax for function
signature in TLD. Comma ',' expected. Tag Library: {0}, Function: {1}.
jsp.error.tld.fn.invalid.signature.parenexpected=Invalid syntax for function
signature in TLD. Parenthesis '(' expected. Tag Library: {0}, Function: {1}.
-
jsp.error.dynamic.attributes.not.implemented=The {0} tag declares that it accepts
dynamic attributes but does not implement the required interface
jsp.error.nomatching.fragment=Cannot find an attribute directive (with name={0} and
fragment=true) prior to the fragment directive.
jsp.error.attribute.noequal=equal symbol expected
@@ -340,3 +332,4 @@
jsp.error.xml.closeQuoteMissingInTextDecl = closing quote in the value following
\"{0}\" in the text declaration is missing.
jsp.error.xml.closeQuoteMissingInXMLDecl = closing quote in the value following
\"{0}\" in the XML declaration is missing.
jsp.error.xml.invalidHighSurrogate = High surrogate bits in UTF-8 sequence must not
exceed 0x10 but found 0x{0}.
+jsp.error.attributes.not.allowed = {0} must not have any attributes
1.23 +2 -1
jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/resources/messages_es.properties
Index: messages_es.properties
===================================================================
RCS file:
/home/cvs/jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/resources/messages_es.properties,v
retrieving revision 1.22
retrieving revision 1.23
diff -u -r1.22 -r1.23
--- messages_es.properties 7 Nov 2002 22:19:13 -0000 1.22
+++ messages_es.properties 8 Nov 2002 19:42:56 -0000 1.23
@@ -258,3 +258,4 @@
jsp.error.xml.closeQuoteMissingInTextDecl=
jsp.error.xml.closeQuoteMissingInXMLDecl=
jsp.error.xml.invalidHighSurrogate=
+jsp.error.attributes.not.allowed=
1.3 +2 -9
jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/resources/messages_fr.properties
Index: messages_fr.properties
===================================================================
RCS file:
/home/cvs/jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/resources/messages_fr.properties,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- messages_fr.properties 7 Nov 2002 22:19:13 -0000 1.2
+++ messages_fr.properties 8 Nov 2002 19:42:56 -0000 1.3
@@ -260,23 +260,15 @@
jsp.error.single.line.number=\n\nUne erreur s''est produite � la ligne: {0} dans le
fichier jsp: {1}\n\n
jsp.error.multiple.line.number=\n\nUne erreur s''est produite entre les lignes: {0}
et {1} dans le fichier jsp: {2}\n\n
jsp.error.corresponding.servlet=Erreur de servlet g�n�r�e:\n
-
jsp.error.empty.body.not.allowed=Un corps vide n'est pas autoris� pour {0}
-jsp.error.jspbody.body.not.allowed.with.value=Un corps n''est pas autoris� pour
jsp:body si un quelconque attribut (comme une value) est sp�cifi�.
-
jsp.error.jspbody.required=Doit utiliser jsp:body pour indiqu� le corps de tag body
de {0} si jsp:attribute est utilis�.
-
jsp.error.jspbody.emptybody.only=Le tag {0} ne peut avoir que jsp:attribute dans
son corps.
-
jsp.error.no.scriptlets=Les �l�ments de Scripting ( <%@, <%!, <%=, <% ) ne sont pas
autoris�s ici.
-
jsp.error.internal.unexpected_node_type=Erreur Interne: Type de node inattendu
rencontr�
-
jsp.error.tld.fn.invalid.signature=Synthaxe invalide pour la signature de fonction
dans la TLD. Librairie de Tag : {0}, Fonction: {1}
jsp.error.tld.fn.invalid.signature.classnotfound=Synthaxe invalide pour la
signature de fonction dans la TLD. Classe introuvable: ${0}. Librairie de Tag: {1},
Fonction: {2}.
jsp.error.tld.fn.invalid.signature.commaexpected=Synthaxe invalide pour la
signature de fonction dans la TLD. Virgule ',' attendue. Librairie de Tag: {0},
Fonction: {1}.
jsp.error.tld.fn.invalid.signature.parenexpected=Synthaxe invalide pour la
signature de fonction dans la TLD. Parenth�se '(' attendue. Librairie de Tag: {0},
Fonction: {1}.
-
jsp.error.dynamic.attributes.not.implemented=Le tag {0} indique qu''il accepte des
attributs dynamics mais n''impl�mente pas l''interface requise
jsp.error.nomatching.fragment=Ne peut trouver une directive attribut (avec pour
nom={0} et fragment=true) avant la directive fragment.
jsp.error.attribute.noequal=Symbole �gal (equal) attendu
@@ -305,3 +297,4 @@
jasper.error.emptybodycontent.nonempty=D''apr�s la TLD, le tag {0} doit �tre vide,
mais ne l''est pas
jsp.error.tagfile.var_name_given_equals_attr_name=Dans le fichier de tag {0},
l''attribut name-given ({1}) de la directive variable est �gal au nom d''attribut de
la directive attribute
jsp.error.useBean.noSession=Il est ill�gal pour useBean d''utiliser une port�e de
session (session scope) quand la page JSP indique (via la directive de page) qu''elle
ne participe pas aux sessions
+jsp.error.attributes.not.allowed=
1.23 +2 -1
jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/resources/messages_ja.properties
Index: messages_ja.properties
===================================================================
RCS file:
/home/cvs/jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/resources/messages_ja.properties,v
retrieving revision 1.22
retrieving revision 1.23
diff -u -r1.22 -r1.23
--- messages_ja.properties 7 Nov 2002 22:19:13 -0000 1.22
+++ messages_ja.properties 8 Nov 2002 19:42:56 -0000 1.23
@@ -289,3 +289,4 @@
jsp.error.xml.closeQuoteMissingInTextDecl=
jsp.error.xml.closeQuoteMissingInXMLDecl=
jsp.error.xml.invalidHighSurrogate=
+jsp.error.attributes.not.allowed=
--
To unsubscribe, e-mail: <mailto:tomcat-dev-unsubscribe@;jakarta.apache.org>
For additional commands, e-mail: <mailto:tomcat-dev-help@;jakarta.apache.org>