Hi all,
I have a question regarding using the html:link tag where I want to have multiple parameters added to the link url dynamically. What I have tried to do is have a bean that I am using on the page context have a method that returns a Map object that contains all the keys and values for the parameters. Each parameter can be accessed through the toString() method as required.
So, for example this is the class with the necessary code:
public class MenuItem {
/** * Empty constructor to conform to JavaBeans convention. * */ public MenuItem() { // empty default constructor }
private Map params = new HashMap();
public Map getMenuParams() { return params; }
........ ......
Then, I try to get the html:link tag to call this bean with the paramProperty field being "menuParams". The logic:iterate tag enumerates through a set of menuItems which may well be causing problems.
<jsp:useBean id="menu" scope="session" class="com.camp.common.menu.Menu"/>
<logic:iterate id="menuitem" name="menu" property="menuItems">
<html:link action="/Menu" paramName="menuitem" paramProperty="menuParams">
<bean:write name="menuitem" property="menuName"/>
</html:link>
<br>
</logic:iterate>
Nothing gets inserted as expected. I do not really want to be creating a Map and adding parameters using a scriptlet but would rather have it call a Map object from the bean I have created. Does anybody have any better way of doing this or could somebody tell me where I am going wrong.
I guess at the end of the day, I have searched on the Internet high and low for a way of being able to create dynamic parameterized urls using html:link within an iteration.
Help anybody!!
Cheers
Tom
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]