title: form submit action not working in spring
body: <p>I have started with a simple form submission example</p>
  
  <p>Below are the files</p>
  
  <p><strong>spring-servlet.xml</strong></p>
  
  
  
  <p>
  
  <pre><code>   xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  
     xmlns:context="http://www.springframework.org/schema/context"
  
     xmlns:p="http://www.springframework.org/schema/p"
  
     xmlns:mvc="http://www.springframework.org/schema/mvc"
  
     xsi:schemaLocation="http://www.springframework.org/schema/beans
  
            http://www.springframework.org/schema/beans/spring-beans-4.0.xsd
  
            http://www.springframework.org/schema/context
  
            http://www.springframework.org/schema/context/spring-context-4.0.xsd
  
            http://www.springframework.org/schema/mvc
  
            http://www.springframework.org/schema/mvc/spring-mvc-4.0.xsd"&gt;
  
  
  
     &lt;context:annotation-config /&gt;
  
     &lt;!-- Scans within the base package of the application for @Components to configure--&gt;
  
     &lt;context:component-scan base-package="com.bankofny.inx.omx.lc.web" /&gt;
  
  
  
     &lt;!-- Enables the Spring MVC @Controller programming model --&gt;
  
     &lt;mvc:annotation-driven /&gt;
  
  
  
     &lt;bean id="messageSource"
  
            class="org.springframework.context.support.ResourceBundleMessageSource"&gt;
  
            &lt;property name="basename" value="resources.application" /&gt;
  
     &lt;/bean&gt;
  
  
  
  
  
     &lt;bean id="viewResolver"
  
            class="org.springframework.web.servlet.view.InternalResourceViewResolver"&gt;
  
            &lt;property name="viewClass"
  
                   value="org.springframework.web.servlet.view.JstlView"&gt;&lt;/property&gt;
  
            &lt;property name="prefix" value="/jsp/"&gt;&lt;/property&gt;
  
            &lt;property name="suffix" value=".jsp"&gt;&lt;/property&gt;
  
     &lt;/bean&gt;
  </code></pre>
  
  <p></p>
  
  <p><strong>testlink.jsp:</strong></p>
  
  <pre><code>&lt;%@ taglib prefix="spring" uri="http://www.springframework.org/tags"%&gt;
  &lt;%@ taglib prefix="form" uri="http://www.springframework.org/tags/form"%&gt;
  &lt;%@ taglib prefix="logic" uri="http://java.sun.com/jsp/jstl/core" %&gt;
  &lt;%@ taglib uri="/WEB-INF/tlc.tld" prefix="tlc" %&gt;
  &lt;%@ taglib uri="/WEB-INF/c.tld" prefix="c" %&gt;
  &lt;form:form action="/ClsSave.jsp" method="POST" &gt;
  &lt;table&gt;
  &lt;tr&gt;
  &lt;td align=right valign=top&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;Type:&amp;nbsp;&lt;/td&gt;
                  &lt;td align=left valign=top&gt;
                     &lt;select id="TypeCode" name="TypeCode"&gt;
                                    &lt;option value="idValue"&gt; Conditions 1&lt;/option&gt;
                                    &lt;option value="idValue"&gt;condition 2&lt;/option&gt;
                             &lt;/select&gt;
  
                  &lt;/td&gt;
                  &lt;/tr&gt;
                  &lt;tr&gt;
                  &lt;!-- Text --&gt;            
                  &lt;td align=right valign=top&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;Text:&amp;nbsp;&lt;/td&gt;
                  &lt;td colspan=3 align=left valign=top&gt;
  
                         &lt;textarea tabindex="3" rows="20" cols="65" id="Text" name="Text" rows="5" cols="30"&gt;&lt;/textarea&gt;
  
  
  
                &lt;/td&gt;
             &lt;/tr&gt;
             &lt;tr&gt;
  
                             &lt;td&gt;&amp;nbsp;
                                    &lt;a href="javascript:submitPageX();"&gt;
                         Save
                      &lt;/a&gt;  
  
                             &amp;nbsp;|&amp;nbsp;&lt;/td&gt;
                             &lt;/tr&gt;
  &lt;/table&gt;
  &lt;/form:form&gt;
  
  &lt;script&gt;
  function submitPageX()
  {
         alert("submitted");
  }
  &lt;/script&gt;
  </code></pre>
  
  <p><strong>Controller:</strong></p>
  
  <pre><code>@Controller
  @SessionAttributes("clsData")
  public class InformLoginAction {
  
  
      /**
       * Process the login form
       */
  
      @ModelAttribute("clsData")
      public ClauseData createBean() {
          return new ClauseData();
      }
  
      @RequestMapping(value = "/ClsSave", method = RequestMethod.POST)
      public ModelAndView execute(HttpServletRequest  request,
              HttpServletResponse response,
              @ModelAttribute("clsData") ClauseData clauseData,
              BindingResult bindingResult,
              Model model)
      {
         return new ModelAndView("blank");
      }
  
  
  
      @RequestMapping(value = "/informlogin", method = RequestMethod.GET)
      public ModelAndView execute( HttpServletRequest  request,
                                   HttpServletResponse response,
                                   @ModelAttribute("clsData") ClauseData clauseData,
                                   BindingResult bindingResult)
          throws Exception {
  .
  .
  .
  .
  .
  . return modelAndView;
  
      }
  }
  </code></pre>
  
  <p><strong>blank.jsp</strong></p>
  
  <pre><code>form successfully submitted
  </code></pre>
  
  <p>My jsp page is found in</p>
  
  <p>tradelc\src\main\webapp\jsp\testlink.jsp</p>
  
  <p>tradelc\src\main\webapp\jsp\blank.jsp</p>
  
  <p>When I give <a href="http://localhost:8181/tradelc/jsp/testlink.jsp" rel="nofollow">http://localhost:8181/tradelc/jsp/testlink.jsp</a>, my testlink pages loads. But when I click on submit link, nothing happens after the js alert</p>