You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@struts.apache.org by bu...@apache.org on 2003/02/09 19:35:53 UTC

DO NOT REPLY [Bug 16916] New: - using incorrect bean

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=16916>.
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=16916

<nested:write> using incorrect bean

           Summary: <nested:write> using incorrect bean
           Product: Struts
           Version: 1.1 Beta 3
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: Major
          Priority: Other
         Component: Custom Tags
        AssignedTo: struts-dev@jakarta.apache.org
        ReportedBy: sri.sankaran@sas.com


Preface:  This is *not* the same as bug #15799!

Using <nested:write> results in the no getter for property abc in bean xyz error

I ran into this problem on Tomcat 4.1.18 while using Struts 1.1b3.  Upon seeing 
bug #15799, I even tried one of the nightlies to no avail.

My investigation of this problem has lead to the conclusion that this is 
happening because 

(a) Tomcat pools Tags using the TagHandlerPool class and
(b) When a <nested:write> is re-used, it isn't being properly re-initialized

To explain further, consider the following JSP snippet

<nested:root name="fruit">
  <nested:write property="color"/>
</nested:root>

<nested:root name="person">
  <nested:write property="age"/>
</nested:root>

Using a simple Fruit class (properties of color, etc) and a Person class 
(properties of age, etc) the above JSP will fail to load with the error 

No getter method for property age of bean fruit

The reason for this, is that the TagHandlerPool for <nested:write> recycles the 
NestedWriteTag instance that was used for

<nested:write property="color"/>

However, the "parent" property of the tag is never changed from "fruit" 
to "person".  Hence the error.

---------------------------------------------------------------------
To unsubscribe, e-mail: struts-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-dev-help@jakarta.apache.org