Title: Message
Two ways to attach such task.
 
First one is to use three different forms for these three actions, in the server side are there three action classes, UpdateAction, DeleteAction, AbortAction. Then define action path in struts' configuration file so that struts will invoke proper action class for different form submission.
 
Second one will utilize same action class and same form for all three operations. In the html page, different values are used for these three submit buttons. In the server side action class, you define three methods to handle different cases.  In this action class' perform function, you check the submit button value and invoke proper method. This method is similar to front controller pattern.
 
Hope this helps.
-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Sunil Narvekar
Sent: Thursday, September 04, 2003 12:10 PM
To: Research Triangle Java User's Group mailing list.
Subject: [Juglist] Struts question

I have a JSP form with three submit buttons on it such as Update, Delete and Abort.

I created struts action classes .. UpdateAction, DeleteAction and AbortAction with an execute() method in each of them which performs the necessary action.

How do I setup the struts configuration file, so that each time I press a submit button, it performs the intended action. For example, when Update button is pressed - invoke UpdateAction's execute() method.

I know one way of doing this is by using the org.apache.struts.actions.LookupDispathAction class. It requires you to write one class with multiple methods(for example update(), delete() and abort()), where one of the methods will be invoked based on value of a special request parameter sprcified in the configuration file. 

What if I do not want to combine the several actions in one class, but have one action class for each submit button on the JSP page?. Please let me know if anyone has done this. This is my first Struts project.

Thanks

Sunil Narvekar

 

  

 

 

 


Do you Yahoo!?
Yahoo! SiteBuilder - Free, easy-to-use web site design software
_______________________________________________
Juglist mailing list
[EMAIL PROTECTED]
http://trijug.org/mailman/listinfo/juglist_trijug.org

Reply via email to