I have a simple Struts app that's connected to a DB. I can search for an "employee" and now I want to add the functionality to add an employee, so I have two buttons in a JSP page. When I come to the Action/controller page, how can I know which button that has been pressed, i.e, which form that is populated? Can I set a variable in the JSP page, or what kind of info can I retrieve from the JSP page.
posted 9 years ago
Rather than having buttons If you can have two hyperlinks that would solve the issue as you can call different actions..
If you have two buttons ..I am not sure .. but try enclosing them in two different forms within the same jsp..