• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Paul Clapham
  • Tim Cooke
  • Jeanne Boyarsky
  • Liutauras Vilda
Sheriffs:
  • Frank Carver
  • Henry Wong
  • Ron McLeod
Saloon Keepers:
  • Tim Moores
  • Frits Walraven
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
Bartenders:
  • Al Hobbs
  • Piet Souris
  • Himai Minh

dynamic hyperlink (struts & ?JSTL)

 
Greenhorn
Posts: 22
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
i'm trying to create a dynamic hyperlink using struts (v1.2.8) and JSTL as below:

<html:link action="MyGenericLink">
<fmt:message key="cancel.button"/>
</html:link>


I want to ensure that MyGenericLinkis whatever the user passes in in the request (in a request parameter called link eg)

i'm trying to

<html:link action="<%= request.getParameter(�link�) %>">
<fmt:message key="cancel.button"/>
</html:link>

this doesnt seem to work, is there a handier way? maybe JSTL only? can someone provide me with a code sample if pos?
 
Sheriff
Posts: 67665
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

with a code sample if pos?



"pos" is not a word. Please use real words when posting to the Ranch.
[ November 03, 2006: Message edited by: Bear Bibeault ]
 
Bear Bibeault
Sheriff
Posts: 67665
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I'm sure you can do what you need to do in pure JSTL and EL. Rather than relying upon people knowing what the proprietary Struts tags do, why not post what you are trying to accomplish?
 
Bartender
Posts: 1845
10
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
What you have posted there should theoretically work.
You say it doesn't - what doesn't work about it?

You are wanting the resulting url to come from a request parameter.
Who sets this request parameter?
What possible values can it take? You are using the "action" attribute with the struts tag which means it should link to a defined struts action.
If you want to link to a URL you should use the href attribute instead maybe?

http://struts.apache.org/1.2.9/userGuide/struts-html.html#link
 
Ranch Hand
Posts: 226
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
[Bear: thread hi-jack removed. Please start your own question in your own topic.]
[ January 17, 2007: Message edited by: Bear Bibeault ]
 
See where your hand is? Not there. It's next to this tiny ad:
the value of filler advertising in 2021
https://coderanch.com/t/730886/filler-advertising
reply
    Bookmark Topic Watch Topic
  • New Topic