• Post Reply Bookmark Topic Watch Topic
  • New Topic

struts html:link not working with portlet  RSS feed

 
Alejandro Barrero
Ranch Hand
Posts: 371
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Dear Sirs:
I hope this is the appropriate forum to ask this question. I am developing a portlet with struts (JSR 168). I am trying to use the tag <html:link to generate a link; I want to generate something like:
<a href="some_url?param=value">
According to the description of<html:link, I should use attributes paramName="param" paramProperty="aproperty". The code that I use is
<logic:iterate id="service" name="startForm" property="services">
<tr>
<%
com.cfmswc.sitessynchronization.businessobjects.Service theService =
(com.cfmswc.sitessynchronization.businessobjects.Service)service;
String value = String.valueOf(theService.getId());
request.setAttribute("value", value);
%>
<td><html:link forward="cm" paramName="service"
paramProperty="value">
<bean:write name="service" property="serviceName" />
</html:link>
</td>
</tr>
</logic:iterate>

Or I could use a list of parameters by using attributes name="aBean" property="map", where map is a java.util.Map with the names and values of the parameters. The code that I use is:
<logic:iterate id="service" name="startForm" property="services">
<tr>
<td><html:link page="/selectCM.do" name="service" property="map">
<bean:write name="service" property="serviceName" />
</html:link></td>
</tr>
</logic:iterate>

I have tried with both options, but the code generated doesn't have the parameter. I just get <a href="some_url">

It should work in plain struts, but the problem may be that I am using it in a portlet with IBM's Rational Application developer.

please help.

Alejandro Barrero
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!