struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Mohit Gupta <motgu...@gmail.com>
Subject Only one Object gets initialized in action class?
Date Sat, 02 Mar 2013 13:48:49 GMT
I have DisplayCustomerAction.java which has two instance fields i.e
customerAddress and  customerData. Both fields have getter/setter
and nnot initialized by default

<s:url namespace="/customer" action="displayCustomer"
method="displayCustomer"  >
    <s:param name="customerAddress.street1" value="Escort Avenue"></s:param>
    <s:param name="customerData.custName" value="Scott"></s:param>
</s:url>


Now on click of one hyper link , i go to my action  and see customerAddress
initialized with street1 value as Escort Avenue
but customerData is not initialized.

But if i do below(just reversed the order of customerData and
customerAddress paramters) then customerData is  initialized
with  with custName as Scott but customerAddress is not initialized.

<s:url namespace="/customer" action="displayCustomer"
method="displayCustomer"  >
    <s:param name="customerData.custName" value="Scott"></s:param>
    <s:param name="customerAddress.street1" value="Escort Avenue"></s:param>
</s:url>

So ony one object is getting initialized. Could anyabody tell me whats
happening here? Why only one object gets initialized?

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message