Results 1 to 2 of 2

Thread: onSubmit does not get invoked on my controller

  1. #1

    Default onSubmit does not get invoked on my controller

    The form loads with all the appropriate values but when I click on the submit button the formBackingObject gets invoked again and the onSubmit doesn't get invoked???

    Here's my bean def:

    <bean id="tranDefGroupDetailController" class="com.x.web.controllers.TranDefGroupDetailCon troller">
    <property name="commandName">
    <value>tranDefGroup</value>
    </property>
    <property name="formView">
    <value>tranDefGroupDetail</value>
    </property>
    <property name="successView">
    <value>tranDefGroupList</value>
    </property>
    </bean>

    Here's code snippet from my controller which extends SimpleFormController

    protected Object formBackingObject(HttpServletRequest request) throws Exception
    {
    long id = RequestUtils.getRequiredLongParameter(request, "tranDefGroupId");
    TranDefGroup tranDefGroup = ConfigurationService.getTranDefGroup(new Long(id));
    return tranDefGroup;
    }

    protected ModelAndView onSubmit(Object command) throws Exception
    {

    TranDefGroup tranDefGroup = (TranDefGroup)command;
    boolean result = ConfigurationService.save(tranDefGroup);
    if(result)
    return new ModelAndView(getSuccessView());
    else
    return new ModelAndView(getFormView());
    }
    cheers,
    Lili

  2. #2

    Default

    Nevermind. I had not added a method="post" to my form tag.
    cheers,
    Lili

Similar Threads

  1. View to forward to another controller?
    By justinp in forum Web
    Replies: 6
    Last Post: Apr 2nd, 2010, 01:53 PM
  2. Order of Bean definitions matters?
    By cfuser in forum Container
    Replies: 2
    Last Post: Oct 21st, 2005, 10:29 AM
  3. Spring container fails with no exception
    By naor in forum Container
    Replies: 9
    Last Post: Oct 1st, 2005, 03:39 PM
  4. EHCaching Hibernate
    By dencamel in forum Data
    Replies: 3
    Last Post: Sep 6th, 2005, 09:03 PM
  5. 'Wrong' controller invoked
    By kantorn in forum Web
    Replies: 2
    Last Post: Jan 4th, 2005, 05:14 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •