wood burning stoves 2.0*
The moose likes EJB and other Java EE Technologies and the fly likes Problem working with indexed properties in a struts based application on WAS 5.0.2 Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » EJB and other Java EE Technologies
Bookmark "Problem working with indexed properties in a struts based application on WAS 5.0.2" Watch "Problem working with indexed properties in a struts based application on WAS 5.0.2" New topic
Author

Problem working with indexed properties in a struts based application on WAS 5.0.2

praveenK soni
Greenhorn

Joined: Oct 11, 2004
Posts: 4
I faced very strange problem while using indexed properties in my Struts 1.1 based application.
I have attached the sample code to illustrate the scenario. Application was desgined using Action Forms & Value objects.
As can be seen from the code sample, my action form has MyPageVO type property along with other string type properties. Required getter/setter are provided in Action From.

MyPageVO has an indexed property: TargetVO (an ArrayList) and a string type property: UserCode. Elements of collection TargetVO are of type MyTargetVO. MyPageVO has two overloaded methods
i) setTargetVO(ArrayList pobjTargetVO)
Sets the property objTargetVO as a whole
ii) setTargetVO(int pintIndex, Object pobjElement)
Sets individual members of ArrayList objTargetVO at a given index, here pintIndex.

In the JSP, input field were to be rendered by forming their names dynamically (Please see JSP code attached)
The code works fine on Windows 2000 with WebSphere Application Server enterprise edition 5.0.2 but fails (i.e. does not rendered at all) on Solaris 8 with WebSphere Application Server enterprise edition 5.0.2

After a lot of brain-storming we figured out that the overloading of setTargetVO method was causing the problem.
After changing the method name in bean MyPageVO from setTargetVO(int pintIndex, Object pobjElement) to setTargetVOAtIndex(int pintIndex, Object pobjElement) and similiarly in JSP input field name from pageVO.targetVO[idx].target to pageVO.targetVOAtIndex[idx].target page was rendered correctly on Solaris as well.
Though I was able to resolve the issue on solaris as well but I am unable to understand the reason, I request you all there to please help me on this strange behavior of WAS on Solaris ASAP.

Thanks in anticipation.
Praveen Soni
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
 
subject: Problem working with indexed properties in a struts based application on WAS 5.0.2
 
Similar Threads
displaying data from arrays with html:text
Indexed Properties Example
Indexed Setting/properties
Exception thrown by getter for property
Iterator and multibox