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
|