Based on the given bug id, I would propose a different implementation than that found in 5.0.20.

Specifically I would suggest that Generator:

  1. Try to load the given class.
  2. Look up its default (no-args) constructor via reflection.  [This
     is the key part, look up the constructor but don't call it!]
  3. If a public no-args constructor IS found, then code should be
     generated to use it to directly instantiate the bean.
  4. If a public no-args constructor is NOT found, then a page error
     should be generated and Beans.instantiate() should be used if
     errorOnUseBeanInvalidClassAttribute is set to false.

This should be more efficient, avoid breaking pages using beans with non-trivial environmental constraints for successful construction, and follow the letter of the spec better as I see it.

--
Jess Holle

Tim Funk wrote:

http://nagoya.apache.org/bugzilla/show_bug.cgi?id=26444

-Tim

Jess Holle wrote:

Jess Holle wrote:

Unfortunately, Tomcat 5.0.20 cannot compile 6 out our 985 JSP pages (which Tomcat 5.0.19 compiled just fine).

The issue can be traced directly to a single entry in the change log:

Add some intellignece to the compiler for generating code for
useBean action. Generate direct instantiation (use new) when
possible, use bean.instantiate when bean name is specified, and for
the case of invalid bean class, either issue a translation time
error (instead of javac error), or generate codes to throw
InstantiationException at runtime, depending on a new compiler
switch, errorOnUseBeanInvalidClassAttribute(defaulted to true) (kinman)


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





Reply via email to