Granny's Programming Pearls
"inside of every large program is a small program struggling to get out"
JavaRanch.com/granny.jsp
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Hidden Variables and Hyper Link

 
Maneesh Chauahn
Ranch Hand
Posts: 48
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi All,
I have a question on the hidden variables . I have a simple JSP page

<form name = "XXXX" method = "POST" action "">

< input type = "hidden" name = "a" value = "a"
<td align="right"><a href="/nams/svc/myaccount/save/ealert"><img src="/templates/nams/images/btn_close.gif" width="83" height="22" border="0"></a></td>

</form>

As in the above the action is empty so when i link on the hyper link . will the hidden variable also pass with the request.

Means can i pass the hidden variables by click on the hyper - link and this hyper link point to action defined in the strust-config.xml

Thanks in advance for your prompt answer

Maneesh Chauhan
 
William Brogden
Author and all-around good cowpoke
Rancher
Posts: 13045
6
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What happened when you tried it?
 
Richard Green
Ranch Hand
Posts: 536
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Clicking on a hyper link will always use HTTP GET (not POST).
 
Adeel Ansari
Ranch Hand
Posts: 2874
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Clicking on the link is redirecting to that URL. If you want your form fields on the server you need to submit the page/form. Other option would be make your hidden fields part of the link's URL.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic