• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Question on Links using struts

 
Anonymous
Ranch Hand
Posts: 18944
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have a page with links
eg
<a href = /a.do>A</a>
<a href = /a.do>B<a>

Both the links have the same input form but the data output is different.
For eg Both take employeeID as input
but
A links output is salary and commision
B links output is name and dOB.

So I would like to have one input form but would want different outputs generated. My question is how do I know which link the user has clicked. I am using struts. I do not want to append anything to URL.
[ August 13, 2004: Message edited by: shan javan ]
 
Junilu Lacar
Bartender
Pie
Posts: 7465
50
Android Eclipse IDE IntelliJ IDE Java Linux Mac Scala Spring Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by shan javan:
So I would like to have one input form but would want different outputs generated. My question is how do I know which link the user has clicked. I am using struts. I do not want to append anything to URL.


You can use different action mappings instead, both associated with the same form:

action path="showSalCom" name="myForm"
action path="showName" name="myForm"

However, unless you're actually using a submit button, I don't see how you're going to tell who's salary and commission or name to show if you just use a link to send a request.
 
Anonymous
Ranch Hand
Posts: 18944
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Can you suggest something ? or else I have to create the same input form twice and the submit button would call different .do.

Any help or ideas?
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic