• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Bear Bibeault
  • Ron McLeod
  • Jeanne Boyarsky
  • Paul Clapham
Sheriffs:
  • Tim Cooke
  • Liutauras Vilda
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • fred rosenberger
  • salvin francis
Bartenders:
  • Piet Souris
  • Frits Walraven
  • Carey Brown

Using HashMap in ActionForm class

 
Ranch Hand
Posts: 208
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi
In my page i like to write like this:

<html:form action="/hashmaptest">
<html:text property= "setValue(firstName)" />
<html:submit property="submit"/>
</html:form>

means i want to make a HashMap in ActionForm class.
Please tell me that how to code for ActionForm Class.

Thanks
Regards
Gaurav
 
Ranch Hand
Posts: 4864
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
See the heading "Mapped Properties" in this link for an explanation of how to use mapped properties.

In your example, the following would work:

<html:text property="myMap(firstName)" />

provided you have a HashMap in your ActionForm bean and getMyMap(String key) and setMyMap(String key, String value) methods.
 
He was expelled for perverse baking experiments. This tiny ad is a model student:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
    Bookmark Topic Watch Topic
  • New Topic