At end. > -----Original Message----- > From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] > > I have been struggling in vain to use the <html:link> tag with multiple > parameters. I know you're supposed to use a java.util.Map to hold the > parameters, since there could be any number of them, but the question is, > how do you set up this map within a scriptlet when you can't access > formbean properties from scriptlets??! > > It so happens I am in a loop, and want to pull in two parameters, one of > which is a property of the bean being iterated over in the loop. > I want to do something like: > > <logic:iterate name="systemForm" property="subSystems" id="subSystem"> > <tr> > <td><bean:write name="subSystem" property="systemCode" /></td> > <td><bean:write name="subSystem" property="shortName" /></td> > <td><bean:write name="subSystem" property="longName" /></td> > <td> > <% > Map map = new Map(); > ***** impossible part coming up *********** > map.put("systemCode", <bean:write name="systemForm" property > ="systemCode"/>); > map.put("systemCode", <bean:write name="subSystem" property="systemCode" > />); > ***** end impossible part ********** > %> > <html:link href="editSubSystemPrepare.do" paramName > ="map">Edit</html:link> > </td> > </tr> > </logic:iterate> > > I have searched many times and found no answer to this problem. Help!!
First of all, the "id" attribute of "logic:iterate" specifies the name of the scriptlet variable to create to hold the value. You can then reference that scriptlet variable in a scriptlet inside the loop. Your code which is creating the map properties is confusing. I'm not sure what you meant to do, as you're trying to use the same key for both entries. In any case, your second parameter to "map.put()" would just be: subSystem.getSystemCode().toString() (The ".toString()" might be unnecessary.) --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]