Hi, I have an object that I iterate over, and generate rows of hyper-links in my jsp page. The way I'm constructing the href is: in a for loop, I have the following: <a href="/userShow.do?userValue="+dataList.get(i)%>" > <%=dataNameList.get(i)%></a>
A user sees a list of names, and clicking on any one of them will take them to userShow.do action, where they can see its details. But, the resulting page displays the userValue in the address bar, which is a sensitive piece of information.
What is the best way to pass the value from a loop, in a href, to the next action ?
You consider "userValue" as a sensitive piece of information and you use it as hypertext link label ??
Doesn't make sense to me...
Maybe use a "userId" instead of a full name then retrieve the associated "userValue" right in the "userShow" Action. Or use a Form submit with hidden field for each row as proposed by Steven. Or use a frame at your application top level to 'hide' actual Actions requests from address bar.
Mallika R Kumar
Joined: Jan 21, 2004
Hi, Thanks for the responses. If I use a hidden input in the loop, then my actionform bean contains a list of values for the field, and picks the first value. This is not what I want to accomplish. How can I use post method, if I want to pass user values being generated dynamically in the loop ? If there were a submit button, and the dynamic value that needed to be passed for a field was not coming from a loop, then hidden input makes sense. But, based on the link a user clicks, I need to send that link's value. Other option is for me to have a key value mapping, for the name clicked on and its value, then populate my bean with this value, and do processing. Will <html:link> pass values to my bean from the loop ? What is the best way to do this ?