aspose file tools*
The moose likes Struts and the fly likes Question on Links using struts Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "Question on Links using struts" Watch "Question on Links using struts" New topic
Author

Question on Links using struts

Anonymous
Ranch Hand

Joined: Nov 22, 2008
Posts: 18944
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

Joined: Feb 26, 2001
Posts: 5288
    
  10

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.


Junilu - [How to Ask Questions] [How to Answer Questions]
Anonymous
Ranch Hand

Joined: Nov 22, 2008
Posts: 18944
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?
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Question on Links using struts