Hello all,
This mini-patch provides a minor improvement to the formatting of the
code generated for the useBean action.
Whilst hardly earth shattering, it has been bugging me :-)
Patch against Tomcat 4.0.4.
Regards,
Doug
--- BeanGenerator.java.original Sat Jul 27 12:06:30 2002
+++ BeanGenerator.java Sat Jul 27 12:11:20 2002
@@ -300,7 +300,7 @@
String name,
String scope) {
- writer.println (varname + "= (" + type + ")");
+ writer.println (varname + " = (" + type + ")");
writer.println ("pageContext.getAttribute(" +
writer.quoteString(name) + "," + scope + ");");
}
@@ -312,7 +312,7 @@
// Create the bean only if classname is specified.
// Otherwise bean must be located in the scope.
if (clsname != null || beanName != null) {
- writer.println ("if ( "+varname+" == null ) {");
+ writer.println ("if ("+varname+" == null) {");
// Code to create the bean:
writer.pushIndent ();
@@ -332,7 +332,7 @@
else {
// clsname not specified -- object must be found inside the scope.
- writer.println ("if (" + varname + " == null) ");
+ writer.println ("if (" + varname + " == null) ");
writer.println (" throw new java.lang.InstantiationException (\"bean " +
varname + " not found within scope \"); ");
}
@@ -366,7 +366,7 @@
writer.println ("} catch (Exception exc) {");
writer.pushIndent ();
writer.println (" throw new ServletException (\" Cannot create bean of class
\"" +
- "+\"" + clsname + "\", exc);");
+ " + \"" + clsname + "\", exc);");
writer.popIndent ();
writer.println ("}");
--
To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>