DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT <http://nagoya.apache.org/bugzilla/show_bug.cgi?id=26507>. ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND INSERTED IN THE BUG DATABASE.
http://nagoya.apache.org/bugzilla/show_bug.cgi?id=26507 Jasper Generator java Error (useBean ObjectArray) Summary: Jasper Generator java Error (useBean ObjectArray) Product: Tomcat 5 Version: 5.0.18 Platform: Other OS/Version: Other Status: NEW Severity: Normal Priority: Other Component: Jasper AssignedTo: [EMAIL PROTECTED] ReportedBy: [EMAIL PROTECTED] JSP Code in - DataField implements Serializable <jsp:useBean id="arrayPath" scope="request" class="DataField[]"/> Generator.java run.... --------------------- DataField[] arrayPath = null; synchronized (request) { arrayPath = (DataField[]) pageContext.getAttribute("arrayPath", PageContext.REQUEST_SCOPE); if (arrayPath == null){ arrayPath = new DataField[](); # this code is Compile Error & Generator Error pageContext.setAttribute("arrayPath", arrayPath, PageContext.REQUEST_SCOPE); } } ------------------------------------------- --- Generator.java.orig 2004-01-27 17:29:06.671875000 +0900 +++ Generator.java 2004-01-28 10:27:49.953125000 +0900 @@ -1259,41 +1259,37 @@ className = attributeValue(beanName, false, String.class); } - out.printil("try {"); - out.pushIndent(); - out.printin(name); - out.print(" = ("); - out.print(type); - out.print(") java.beans.Beans.instantiate("); - out.print("this.getClass().getClassLoader(), "); - out.print(className); - out.println(");"); - out.popIndent(); - /* - * Note: Beans.instantiate throws ClassNotFoundException - * if the bean class is abstract. - */ - out.printil("} catch (ClassNotFoundException exc) {"); - out.pushIndent(); - out.printil( - "throw new InstantiationException(exc.getMessage());"); - out.popIndent(); - out.printil("} catch (Exception exc) {"); - out.pushIndent(); - out.printin("throw new ServletException("); - out.print("\"Cannot create bean of class \" + "); - out.print(className); - out.println(", exc);"); - out.popIndent(); - out.printil("}"); // close of try - } else { - // Implies klass is not null - // Generate codes to instantiate the bean class - out.printin(name); - out.print(" = new "); - out.print(klass); - out.print("();"); - } + } else { + className = klass; + } + out.printil("try {"); + out.pushIndent(); + out.printin(name); + out.print(" = ("); + out.print(type); + out.print(") java.beans.Beans.instantiate("); + out.print("this.getClass().getClassLoader(), \""); + out.print(className); + out.println("\");"); + out.popIndent(); + /* + * Note: Beans.instantiate throws ClassNotFoundException + * if the bean class is abstract. + */ + out.printil("} catch (ClassNotFoundException exc) {"); + out.pushIndent(); + out.printil( + "throw new InstantiationException(exc.getMessage());"); + out.popIndent(); + out.printil("} catch (Exception exc) {"); + out.pushIndent(); + out.printin("throw new ServletException("); + out.print("\"Cannot create bean of class \" + \""); + out.print(className); + out.println("\", exc);"); + out.popIndent(); + out.printil("}"); // close of try + /* * Set attribute for bean in the specified scope */ --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]