Hi All,
I have a simple form with two submit buttons.
amber.jsp
<form method="post" action="<portlet:actionURL/>">
<input type="submit" name="check" value="Check"/>
<input type="submit" name="submit" value="Submit"/>
</form>
I'm trying to find which submit button was hit in the portal. Here is the controller code.
public class AmberController extends SimpleFormController
{
public ModelAndView onSubmitRender(RenderRequest rreq, RenderResponse rres, Object command, BindException errors) throws Exception
{
if(rreq.getParameter("Submit")=="Submit")
{
ModelAndView mav = new ModelAndView("success");
return mav;
}
else
{
ModelAndView mav = new ModelAndView("amber");
return mav;
}
}
}
But rreq.getParameter("Submit") always returns null. I'm not sure if Action request parameters can be accessed in onSubmitRender function. I'm very new to SpringMVC.
Regards
Deepan