• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

struts html:link not working with portlet

 
Ranch Hand
Posts: 502
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic