<logic:iterate id="myObj" name="result" scope="request">
<bean:write name="myObj" property="value"/>
</logic:iterate>
This should do the job.
--
John
At 02:56 am 22-10-2001 -0700, you wrote:
Dear all,
I'm making MVC webapps with struts tags using HashMap as request attribute.
I have stuck at one point:
I want to show the HashMap (which contains custom object) which works as
myHashMap.put(Integer i, MyObj myObj);
...and myObj returns String value by "myObj.getValue()".
currently I'm trying following codes in order to show "myObj.getValue()"
on jsp page:
---TestAction.java---
public ActionForward perform( ActionMapping mapping,
ActionForm form,
HttpServletRequest req,
HttpServletResponse res ) {
....create myHashMap instance
myHashMap.put(new Integer(i), new myObj());
...put the values
req.setAttribute("result", myHashMap);
return (mapping.findForward("resultPage"));
}
---result.jsp---
...
<logic:iterate id="myObj"
name="result"
scope="request"
type="java.util.HashMap">
<bean:write name="myObj" ?how to display myObj.getValue()?/>
</logic:iterate>
...
...and result.jsp doesn't work. Although I carefully examined the Struts logic
reference page, but I don't find how to call myObj.getValue() with struts tags.
Does anybody show me some tips for this?
Really thanks in advance,
Ken
John Yu Scioworks Technologies
e: [EMAIL PROTECTED] w: +(65) 873 5989
w: http://www.scioworks.com m: +(65) 9782 9610