Hello friends - 
  I'm struggling with what I believe to be a relatively simple problem, but 
haven't hit on a solution yet. I need to dynamically create links with a series 
of parameter values, and have the link of the text vary. 
   
  For example, I have relatively simple object:
  public class Child {
   private int childId;
 
 //gets / sets for each
 // Other properties / gets and sets as appropriate. 
}
   
  On my form, there may be one or more Child objects.  I also have an array of 
Dates available, or if need be, a String array containing the mm/dd/yyyy value 
of a series of dates, say one week into the past.  
  For each, child, I need to create seven links, one for each date, with 
passing the childId and date representation in the query string, i.e., lets say 
I have these values:
   
  Child 1 - childId = 1
Child 2 - childId = 2
  String[] dates = String[7];
dates[0] = '01/01/2006';
... 
dates[6] = '01/07/2006';
  
Desired rendered html:
<a href="myAction.do?do=whatever&childId=1&date=01/01/2006">01/01/2006</a>
<a href="myAction.do?do=whatever&childId=1&date=01/02/2006">01/02/2006</a>
..
<a href="myAction.do?do=whatever&childId=2&date=01/07/2006">01/07/2006</a>
   
  I've studied up enough to realize that if I want the query string to have 
multiple parameters, that I must have a HashMap of available somehwhere in the 
session.  I was able to get to a point where I could render this:
   
  <a href="myAction.do?do=whatever&childId=1&date=01/01/2006">static text</a>
<a href="myAction.do?do=whatever&childId=1&date=01/02/2006">static text</a>
..
<a href="myAction.do?do=whatever&childId=2&date=01/07/2006">static text</a>
   
  by pushing an array of HashMaps into the session, one for each desired link, 
and getting through them with <logic:iterate>.  But, once there, I have no 
mechanism to dynamically populate my link text.  
   
  What is really ticking me off is the fact that if I decided to abandon struts 
and package some java inside of a few <% // DO JAVA ON THE JSP HERE %> tags 
this wouldn't be difficult, but I'd like
to play by the rules and learn something along the way.  
   
  Surely this is something that many people have run into and someone has 
solved.  
  
Any insight is highly appreciated!  Thanks!
  -brian


                
---------------------------------
Love cheap thrills? Enjoy PC-to-Phone  calls to 30+ countries for just 2ยข/min 
with Yahoo! Messenger with Voice.

Reply via email to