• 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
  • Ron McLeod
  • Paul Clapham
  • Tim Cooke
  • Devaka Cooray
Sheriffs:
  • Liutauras Vilda
  • paul wheaton
  • Rob Spoor
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Piet Souris
  • Mikalai Zaikin
Bartenders:
  • Carey Brown
  • Roland Mueller

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: 67750
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: 67750
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 ]
 
It sure was nice of your sister to lend us her car. Let's show our appreciation by sharing this tiny ad:
We need your help - Coderanch server fundraiser
https://coderanch.com/wiki/782867/Coderanch-server-fundraiser
reply
    Bookmark Topic Watch Topic
  • New Topic