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 Mon, 04 Mar 2013 08:47:52 GMT
Yes exaclty this is the case. Just to stress the point again the objects in
action (where values should be transferred)
like customerData,customerAddress are null by default. But that should not
matter . If i am passing the value from jsp as action url they should be
transferred in appropriate objects. Right?

On Mon, Mar 4, 2013 at 11:55 AM, Lukasz Lenart <lukaszlenart@apache.org>wrote:

> 2013/3/3 Mohit Gupta <motgupta@gmail.com>:
> > By initialization i mean  when i hit the url stated in my example, i
> should
> > be able to see below objects should be initialized in my action class
> >
> > customerData object should be initialized with custName as "Scott"
> > customerAddress object should be initialized with street1 as "Escort
> Avenue"
> > ShoppingDetail object should be initialized with item as "Laptop"
> >
> > Yes all my objects have default constructor and have setters for propertu
> > for the value i am setting thru s:param.
>
> Ok, but <s:param/> has nothing to do with object initialisation (it
> can have but then it'll be misuse). It simple reads value or uses
> constants (as in your case) to build params in url. So you should see
> url like this:
>
> /customer.action?customerData.custName=Scott&customerAddress.street1=Escort
> Avenue&shoppingDetail.item=Laptop
>
> and when you hit the link, params should be transferred onto your
> action, appropriate objects should be constructed and dedicated fields
> updated, which means you must have getters for these objects and
> setters for the fields.
>
> Is that your case? You hit the url and your action is missing the values?
>
>
> Regards
> --
> Ɓukasz
> + 48 606 323 122 http://www.lenart.org.pl/
>
> ---------------------------------------------------------------------
> 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