I am designing a web application where i want to use maximum of struts tag on JSP page instead of java code.
In my case,
one of the action is taking input from a JSP >> fetching data from db as per input >> populating Hashmap with output beans >> Putting hashmap into session >> iterating hashmap on JSP
Why i need hashmap : On the result JSP, i am generating link having Hashmap key as a parameter. So that the next action can get bean from HashMap easily without requesting to DB or any iteration.
In Addition: Before displaying data on result JSP, i require to format some of the data. I can not format this data while populating hashmap, because this data might be required further to store back into db.
How can i do above task using logic iterator and bean:write tags?
*I don’t think that creating an extra form variable would be a better approach, instead of putting result bean into session variable.
In Struts2/OGNL tags, you can access values from a map using
map[key].Reference:
iteratortag reference and examplesRegarding formatting, would you able to specify exactly what you need to format?