Hi,
I have started developing some real life jsp
applications with Struts now.
I have a rather simple question which might have
addresed in Struts , but I could not figure it out.
I have two questions
1. When a html form (using struts) has 2 buttons -
Submit and Cancel(<html:cancel>. Submit will validate
the form before going any further.
Cancel button however bypasses the validation and goes
straight to perfom method in the Action.
Actually I just want to go to a page cancel.jsp on
pressng cancel button.
What is the right way to do it ?
I can think of only one way - In perform method, check
if req.getParameter(Constants.CANCEL_PROPERTY) ==
"cancel" and then findforward("cancelpage")
where cancelpage is mapped as a global forward to
cancel.jsp
Is there any better way, please advise.
2. When there are multiple buttons(4 to 5) in a form
what is the generic procedure adopted ?
esp when
button B1 should check for something and then go to
Page A or Page B
Button B2 always takes me to PageC
etc...
Is it still the same req.getParameter() advised here
I appreciate any and all of your suggestions.
Thanks a lot,
Srikanth
__________________________________________________
Do You Yahoo!?
Yahoo! Auctions - Buy the things you want at great prices.
http://auctions.yahoo.com/