File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes JSP and the fly likes HTML form submission Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Java » JSP
Bookmark "HTML form submission" Watch "HTML form submission" New topic
Author

HTML form submission

Dwarka Prasad
Greenhorn

Joined: Dec 26, 2007
Posts: 1
Hi,
I need to submit a HTML form with data's for three different actions Viz, 1. Updation 2. Deletion 3. View

This HTML form contains a table of data resulted from a search. With this data i must be able to perform any of the above mentioned three actions. Using a submit button can solve only one of the three actions.

Is there any way to recognize the resultant flow in the Action class so that i can perform the corresponding action.

Thanks on advance...

Regards,
Dwarka
Bosun Bello
Ranch Hand

Joined: Nov 06, 2000
Posts: 1506
You can create a button for each of the actions, then check the button name/value in the methos that's handling it to determine which action is required. If you do not want to use more than 1 button, then you can create an option button that will correspond to each of the possible actions, or even a hidden field, and then set it to an appropriate action before the submit.
[ December 26, 2007: Message edited by: Bosun Bello ]

Bosun (SCJP, SCWCD)
So much trouble in the world -- Bob Marley
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 60050
    
  65

"Dwarka", please check your private messages.


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: HTML form submission
 
Similar Threads
validation on submit and not on other page actions?
Problem with HTML frames
Can I use only one form in struts?
Actions in Struts
servlet