luehe 2002/07/31 19:12:06
Modified: jasper2/src/share/org/apache/jasper/compiler Generator.java
Log:
more compilation error fixes for generated tag handler files
Revision Changes Path
1.54 +25 -25
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.53
retrieving revision 1.54
diff -u -r1.53 -r1.54
--- Generator.java 1 Aug 2002 00:32:29 -0000 1.53
+++ Generator.java 1 Aug 2002 02:12:05 -0000 1.54
@@ -1736,7 +1736,7 @@
public void visit(Node.ParamAction n) throws JasperException {
out.printin("params.put(");
- out.print(n.getAttributeValue("name"));
+ out.print(quote(n.getAttributeValue("name")));
out.print(", ");
out.print(attributeValue(n.getValue(), false,
String.class, "null"));
@@ -1765,9 +1765,9 @@
// Store varReader in appropriate scope
if (varReader != null) {
String scopeName = n.getAttributeValue("scope");
- out.printin("jspContext.setAttribute(\"");
- out.print(varReader);
- out.print("\", new java.io.StringReader(sout.toString())");
+ out.printin("getJspContext().setAttribute(");
+ out.print(quote(varReader));
+ out.print(", new java.io.StringReader(sout.toString())");
if (scopeName != null) {
out.print(", ");
out.print(getScopeConstant(scopeName));
@@ -1785,7 +1785,7 @@
public void visit(Node.ParamAction n) throws JasperException {
out.printin("params.put(");
- out.print(n.getAttributeValue("name"));
+ out.print(quote(n.getAttributeValue("name")));
out.print(", ");
out.print(attributeValue(n.getValue(), false,
String.class, "null"));
@@ -1812,14 +1812,14 @@
out.printin("params.put(");
String name = tagVars[i].getNameGiven();
if (name != null) {
- out.print(name);
- out.print(", jspContext.getAttribute(");
- out.print(name);
+ out.print(quote(name));
+ out.print(", getJspContext().getAttribute(");
+ out.print(quote(name));
out.println("));");
} else {
String getter =
toGetterMethod(tagVars[i].getNameFromAttribute());
out.print(getter);
- out.print(", jspContext.getAttribute(");
+ out.print(", getJspContext().getAttribute(");
out.print(getter);
out.println("));");
}
@@ -1838,9 +1838,9 @@
// Store varReader in appropriate scope
if (varReader != null) {
String scopeName = n.getAttributeValue("scope");
- out.printin("jspContext.setAttribute(\"");
- out.print(varReader);
- out.print("\", new java.io.StringReader(sout.toString())");
+ out.printin("getJspContext().setAttribute(");
+ out.print(quote(varReader));
+ out.print(", new java.io.StringReader(sout.toString())");
if (scopeName != null) {
out.print(", ");
out.print(getScopeConstant(scopeName));
@@ -2777,8 +2777,8 @@
// if 'varReader' attribute is specified
out.printil("java.io.Writer sout = null;");
- out.printil("javax.servlet.jsp.JspWriter out = jspContext.getOut();");
- out.printil("jspContext.pushPageScope();");
+ out.printil("javax.servlet.jsp.JspWriter out = getJspContext().getOut();");
+ out.printil("getJspContext().pushPageScope(null);");
generatePageScopedVariables(tagInfo);
out.printil("try {");
out.pushIndent();
@@ -2788,7 +2788,7 @@
out.popIndent();
out.printil("} finally {");
out.pushIndent();
- out.printil("jspContext.popPageScope();");
+ out.printil("getJspContext().popPageScope();");
out.popIndent();
out.printil("}");
out.println();
@@ -2936,9 +2936,9 @@
if (attrInfos != null) {
for (int i=0; i<attrInfos.length; i++) {
String attrName = attrInfos[i].getName();
- out.printin("jspContext.setAttribute(\"");
- out.print(attrName);
- out.print("\", ");
+ out.printin("getJspContext().setAttribute(");
+ out.print(quote(attrName));
+ out.print(", ");
out.print(toGetterMethod(attrName));
out.println(");");
}
@@ -2950,9 +2950,9 @@
if (fragAttrInfos != null) {
for (int i=0; i<fragAttrInfos.length; i++) {
String attrName = fragAttrInfos[i].getName();
- out.printin("jspContext.setAttribute(\"");
- out.print(attrName);
- out.print("\", ");
+ out.printin("getJspContext().setAttribute(");
+ out.print(quote(attrName));
+ out.print(", ");
out.print(toGetterMethod(attrName));
out.println(");");
}
@@ -2963,7 +2963,7 @@
out.printil("for (Iterator i = dynamicAttrs.entrySet().iterator();
i.hasNext(); ) {");
out.pushIndent();
out.printil("Map.Entry e = (Map.Entry) i.next();");
- out.printil("this.jspContext.setAttribute(e.getKey(), e.getValue());");
+ out.printil("getJspContext().setAttribute(e.getKey(), e.getValue());");
out.popIndent();
out.printil("}");
}
--
To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>