wood burning stoves 2.0*
The moose likes EJB and other Java EE Technologies and the fly likes Help with html:link Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of OCA/OCP Java SE 7 Programmer I & II Study Guide this week in the OCPJP forum!
JavaRanch » Java Forums » Java » EJB and other Java EE Technologies
Bookmark "Help with html:link" Watch "Help with html:link" New topic
Author

Help with html:link

Kate Wilson
Greenhorn

Joined: Mar 23, 2004
Posts: 12
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

Joined: May 29, 2003
Posts: 1258
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").


Nathaniel Stodard<br />SCJP, SCJD, SCWCD, SCBCD, SCDJWS, ICAD, ICSD, ICED
Kate Wilson
Greenhorn

Joined: Mar 23, 2004
Posts: 12
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
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
 
subject: Help with html:link