File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Struts and the fly likes Simple links Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Java Interview Guide this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "Simple links" Watch "Simple links" New topic

Simple links

Tad Dicks
Ranch Hand

Joined: Nov 16, 2004
Posts: 264
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?

John Smith
Ranch Hand

Joined: Sep 02, 2004
Posts: 61
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

Joined: Nov 16, 2004
Posts: 264
"/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
I agree. Here's the link:
subject: Simple links
jQuery in Action, 3rd edition