ravi_eze wrote:
hi,
i have a form which holds a textfield (name:username). I need to wrap this
username into an object user and insert it into a map as the value object
for the key 'field0'.
Action class:
User user; //with setters and getters.
Map<String, User> map = new LinkedHashMap< .., .. >();//with setters and
getters
Map<String, String> mapString = new LinkedHashMap< .., .. >();//with setters
and getters
JSP:
<s:textfield name="map['field0'].name" /> <!--Throwing errors: parameter
chunk is ignored etc-->
<s:textfield name="mapString['field0']" /> <!-- Filling the object map as:
["field0", nameEnteredInTextbox ] -->
How do i get the map filled as : ["field0",UserObjectHoldingusername ]...
Any ideas as how to get this working?
Type conversion. You have to tell Struts how to turn a String username
into a User object. See the type conversion docs to get started:
http://struts.apache.org/2.0.11/docs/type-conversion.html
L.
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]