struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Lukasz Lenart <lukaszlen...@apache.org>
Subject Re: Only one Object gets initialized in action class?
Date Sat, 02 Mar 2013 13:53:55 GMT
Struts version?

2013/3/2 Mohit Gupta <motgupta@gmail.com>:
> 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?

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


Mime
View raw message