• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

html:link and LookupDispatchAction

 
suc fung
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have a jsp page which has two buttons and a link.

I am using <html:submit> for the buttons and it works fine
in the action class, which extends LookUpDispatchAction.

Now I want to submit the form when I click on the link.

The action tag in my strutsConfig.xml has an attribute 'parameter= something' for the buttons.

How do I send hidden parameters when I click the link ?
What should I add in strutsconfig for the link ?
 
Merrill Higginson
Ranch Hand
Posts: 4864
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You should find the answer to your question in this thread.
 
suc fung
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thank you very much for the response. The 'thread' that you were speaking about explains how to use <a href .... > . But I want to use <html:link> and pass a few hidden variables to the action. I DO NOT want to use any java script. My question is..

Is there a way that i can map the link to a method in LookupDispatchAction's getKeyMethodMap(), wherein i can use the hidden parameters from the jsp ?
 
Merrill Higginson
Ranch Hand
Posts: 4864
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You can substitute <html:link href="" > for <a href=""> if you like. The only difference between the two is that <html:link> performs URL rewriting on the link.

If you restrict yourself from using any JavaScript, your only option is to pass whatever parameters you need in the query string as in:

<html:link href="myAction.do?parm1=abc&parm2=xyz">click here</html:link>

I don't know of a way to send hidden fields on to the URL in a link without using JavaScript.

In my opinion, producing the intuitive and responsive user interfaces that today's users expect without the use of at least some JavaScript is nearly impossible.
 
suc fung
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks again for your prompt response. You are right about the usage of javascript. I even tried using <a href ="javascript:submit()"> something </a>. But it gives me javascript error. Doesn't specify the error but says object not supported. Im using IE 6 .

Thanks again
 
Merrill Higginson
Ranch Hand
Posts: 4864
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Try changing it to:

<a href="javascript:document.forms[0].submit()">something</a>
[ July 12, 2006: Message edited by: Merrill Higginson ]
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic