struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Mohit Gupta <motgu...@gmail.com>
Subject Re: Only one Object gets initialized in action class?
Date Sat, 02 Mar 2013 13:57:58 GMT
struts-2.1

On Sat, Mar 2, 2013 at 7:23 PM, Lukasz Lenart <lukaszlenart@apache.org>wrote:

> 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
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message