It's not a secret anymore!*
The moose likes Struts and the fly likes how to make one jspform have two functions,,as follows Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of OCA/OCP Java SE 7 Programmer I & II Study Guide this week in the OCPJP forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "how to make one jspform have two functions,,as follows" Watch "how to make one jspform have two functions,,as follows" New topic
Author

how to make one jspform have two functions,,as follows

charlse li
Greenhorn

Joined: Aug 03, 2004
Posts: 14
in one jsp form,,i want to firstly let it display dates queried from database,and then customers modifiy some dates in the form and then submit it to database... i don't have one clear idea to work it out ,,will you please give some suggestion?? thank you
Anthony Watson
Ranch Hand

Joined: Sep 25, 2003
Posts: 327
You could create a FormSetupAction that creates a new instance of your form. The FormSetupAction could then acquire data from the data store, and call the corresponding set methods on the form instance. Next, the FormSetupAction could place the form in the request scope (using request.setAttribute) and return the appropriate ActionForward.


Anthony W.<br />MCP, SCJP 1.4, SCJD, SCWCD 1.3, SCWCD 1.4, SCBCD
charlse li
Greenhorn

Joined: Aug 03, 2004
Posts: 14
many thanks!
i have realized it .I use two submit button to do two different things,,and in the ACTION,i retrieve which button customer pressed,and let the code do corresponding act.
 
Consider Paul's rocket mass heater.
 
subject: how to make one jspform have two functions,,as follows