This week's book giveaway is in the OO, Patterns, UML and Refactoring forum. We're giving away four copies of Refactoring for Software Design Smells: Managing Technical Debt and have Girish Suryanarayana, Ganesh Samarthyam & Tushar Sharma on-line! See this thread for details.
I couldn't understand your question properly, but why are you using iterator to generate option elements. You can use the select tag of struts to generate a drop down box. If you want the whole list to be available on the next page, then you'll need to put the list as an attribute in session scope or regenerate the list in the next action...
I have a bean which contains values in a hash map...
How to populate ?? The value name should be the name of the hash map, but it will look for the hashmap in the action corresponding to this jsp whereas the map is in some other class... how to link that bean inside this jsp so that it can locate the required hashmap??
I'm still finding a hard time understanding what you mean, maybe I'm not feeling well .
Anyways, first of all if you use the s:select tag, then you can render the select tag with multiple options directly.
Now what I understand from your statement is that the HashMap which contains the values with which the drop down is to be populated is in an action other than the action which called this JSP. If that is the case, you can call the other action from your JSP using s:action tag. That will put that action on the value stack and thus you'll be able to access the HashMap from it. If I understood it wrong, then please tell me...
Joined: Oct 27, 2009
Yes you got it mate and your doing great and that's what i want,but (silly though) where should i write that s:action tag??