Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Simple links

 
Tad Dicks
Ranch Hand
Posts: 264
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I need to create a list of links, all to the same page but passing a single different parameter.

Using scriplets and not following struts I would just loop over something like


is it possible to do something similiar using
<html:link action=""> ?
if not, how do you implement something like this?

-Tad
 
John Smith
Ranch Hand
Posts: 61
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Put a String array of the parameters on your request and use a logic:iterate loop to iterate through them. I find the html:link tag is mostly just convenient as you can acheive the same target protability by using a html:rewrite into a normal link ...



Not the cleanest solution but it's reliable, hope this is what you were after
 
Tad Dicks
Ranch Hand
Posts: 264
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
"/action/myTarget" /


Does this reference an action in the struts-config file?

using the anchor tags I thought was "bad design" but if your referenceing an action inside the struts-config file instead of an actual jsp page I guess thats equivalent to keep the program "flow" inside the struts-config file?

Some what related question...

If you are creating a link to somewhere outside of your application (to say google or another company's homepage) is acceptable to use a regular anchor tag? or should create action inside the struts-config?

thanks for the help
-Tad
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic