As you can see the tag will iterate and display a couple of links created from the Struts tag html:link.
The problem is that I would like to add some params to the link. The params will be set into the pageContext by my tag LoopLink. But I can not get it right. Please look at this code:
public class LoopLink extends BodyTagSupport { int times = 10;
public void doInitBody() { if(times>0) { HashMap hashMap = new HashMap(); { hashMap.put("id", ""+times); } pageContext.setAttribute("params", hashMap); } }
public int doAfterBody() { if(times>0) { HashMap hashMap = new HashMap(); { hashMap.put("id", ""+times); } pageContext.setAttribute("params", hashMap); return EVAL_BODY_TAG; } else { return SKIP_BODY; } } }
The problem is that the "params" does not seems to change. I just get 10 links with id like: id=10 id=9 id=9 id=9 id=9 id=9 id=9 id=9 id=9 id=9
Tilladte BB-code-tags: [b]fed[/b] [i]kursiv[/i] [u]understreget[/u] Web- og emailadresser omdannes automatisk til links. Der sættes "nofollow" på alle links.