Win a copy of The Java Performance Companion this week in the Performance forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Help with html:link

 
Kate Wilson
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi all,
I'm new to struts. I'm trying a simple application to display a page with 3 links and print the link name that was clicked in the next page. I'm not able to get the value of the link that is clicked. How can I know which link was clicked at run time? Here's my code
<html:link page="/myaction1.do">MyLink1 </html:link>
<html:link page="/myaction2.do">MyLink2 </html:link>
<html:link page="/myaction3.do">MyLink3 </html:link>
in the struts config, I 've mapped all the actions to diff jsp pages.
I tried setting the linkname attribute to get the link clicked. If i do this, the jsp doesn't show the text as a hyperlink.
Can anyone pls help me?
Thanks,
Kate
 
Nathaniel Stoddard
Ranch Hand
Posts: 1258
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The HTTP protocol doesn't give you the text that was clicked on when a user clicks on a link to retrieve some page. If you wanted some sort of information like that, you would have to incorporate it into the link href as parameters (e.g. "/myaction.do?info=stuff").
 
Kate Wilson
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Nathaniel Stoddard:
The HTTP protocol doesn't give you the text that was clicked on when a user clicks on a link to retrieve some page. If you wanted some sort of information like that, you would have to incorporate it into the link href as parameters (e.g. "/myaction.do?info=stuff").

Thanks. It worked.
-Kate
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic