title: No result defined for action actions.AddExam and result input
body: <p>I'm inputting some Data that i want to add to a database. I'm doing it through a form like this:</p>
  
  <pre><code>&lt;s:form theme="simple" action="addExam"&gt;
                  &lt;div id="reg"&gt;
                      &lt;s:textfield name="exam.name" cssErrorClass="register error"
                          placeholder="Exam Name" cssClass="register" required="" /&gt;
                      &lt;s:textfield name="exam.minutesAllotted"
                          placeholder="Minutes Allotted" cssClass="register" required="" /&gt;
                      &lt;s:textfield name="exam.numQuestions"
                          placeholder="Number Of Questions" cssClass="register" required="" /&gt;
                      &lt;sj:datepicker name="exam.startDate" cssClass="register"
                          placeholder="Start Date" displayFormat="dd/mm/yy" required="" /&gt;
                      &lt;sj:datepicker name="exam.endDate" cssClass="register"
                          placeholder="End Date" displayFormat="dd/mm/yy" required="" /&gt;
                  &lt;/div&gt;
                  &lt;!-- Blue Button --&gt;
                  &lt;s:submit type="button" cssClass="button blue" value="Add" /&gt;
              &lt;/s:form&gt;
  </code></pre>
  
  <p>Relevant portion of struts.xml: </p>
  
  <pre><code>&lt;action name="addExam" class="actions.AddExam"&gt;
              &lt;result name="success" type="chain"&gt;display-exams&lt;/result&gt;
              &lt;result name="error"&gt;/add_exam.jsp&lt;/result&gt;
          &lt;/action&gt;
  </code></pre>
  
  <p>And my action is as follows: </p>
  
  <pre><code>public class AddExam extends ActionSupport{
      //Has getter and setter with proper naming convention
      private Exam exam;
  
  
  
      @Override
      public String execute()
      {
          EntityManagerFactory emf = Persistence.createEntityManagerFactory("ExamModulePu");
          EntityManager em = emf.createEntityManager();
          ExamService service = new ExamServiceImplementation(em);
          Exam examResult = service.createExam(exam);
  
          String result;
          if(examResult==null)
          {
              addFieldError("exam.name", "Duplicate Exam Name");
              result = SUCCESS;
          }
          else
              result = ERROR;
  
          em.close();
          emf.close();
          return result;
      }
  </code></pre>
  
  <p>My exam entity looks like this:</p>
  
  <pre><code>@Entity
  public class Exam implements Serializable {
  
      @Id
      @GeneratedValue(strategy = GenerationType.AUTO)
      private long id;
      @Column(unique = true)
      private String name;
      private int numQuestions;
      private int minutesAllotted;
      private Date startDate;
      private Date endDate;
      @OneToMany(mappedBy = "exam", orphanRemoval = true, cascade = CascadeType.ALL)
      private List&lt;Question&gt; questionList;
  }
  </code></pre>
  
  <p><strong>When i input data into this form i get an error "No result defined for action actions.AddExam and result input" with a stacktrace:</strong></p>
  
  <pre><code>No result defined for action actions.AddExam and result input
  
      com.opensymphony.xwork2.DefaultActionInvocation.executeResult(DefaultActionInvocation.java:373)
      com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:275)
      com.opensymphony.xwork2.validator.ValidationInterceptor.doIntercept(ValidationInterceptor.java:265)
      org.apache.struts2.interceptor.validation.AnnotationValidationInterceptor.doIntercept(AnnotationValidationInterceptor.java:68)
      com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:98)
      com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:246)
      com.opensymphony.xwork2.interceptor.ConversionErrorInterceptor.intercept(ConversionErrorInterceptor.java:138)
      com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:246)
      com.opensymphony.xwork2.interceptor.ParametersInterceptor.doIntercept(ParametersInterceptor.java:249)
      com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:98)
      com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:246)
      com.opensymphony.xwork2.interceptor.ParametersInterceptor.doIntercept(ParametersInterceptor.java:249)
      com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:98)
      com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:246)
      com.opensymphony.xwork2.interceptor.StaticParametersInterceptor.intercept(StaticParametersInterceptor.java:191)
      com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:246)
      org.apache.struts2.interceptor.MultiselectInterceptor.intercept(MultiselectInterceptor.java:73)
      com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:246)
      org.apache.struts2.interceptor.CheckboxInterceptor.intercept(CheckboxInterceptor.java:91)
      com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:246)
      org.apache.struts2.interceptor.FileUploadInterceptor.intercept(FileUploadInterceptor.java:252)
      com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:246)
      com.opensymphony.xwork2.interceptor.ModelDrivenInterceptor.intercept(ModelDrivenInterceptor.java:100)
      com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:246)
      com.opensymphony.xwork2.interceptor.ScopedModelDrivenInterceptor.intercept(ScopedModelDrivenInterceptor.java:141)
      com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:246)
      com.opensymphony.xwork2.interceptor.ChainingInterceptor.intercept(ChainingInterceptor.java:145)
      com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:246)
      com.opensymphony.xwork2.interceptor.PrepareInterceptor.doIntercept(PrepareInterceptor.java:171)
      com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:98)
      com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:246)
      com.opensymphony.xwork2.interceptor.I18nInterceptor.intercept(I18nInterceptor.java:176)
      com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:246)
      org.apache.struts2.interceptor.ServletConfigInterceptor.intercept(ServletConfigInterceptor.java:164)
      com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:246)
      com.opensymphony.xwork2.interceptor.AliasInterceptor.intercept(AliasInterceptor.java:193)
      com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:246)
      com.opensymphony.xwork2.interceptor.ExceptionMappingInterceptor.intercept(ExceptionMappingInterceptor.java:187)
      com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:246)
      org.apache.struts2.impl.StrutsActionProxy.execute(StrutsActionProxy.java:54)
      org.apache.struts2.dispatcher.Dispatcher.serviceAction(Dispatcher.java:546)
      org.apache.struts2.dispatcher.ng.ExecuteOperations.executeAction(ExecuteOperations.java:77)
      org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter.doFilter(StrutsPrepareAndExecuteFilter.java:91)
      org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243)
      org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
      org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:222)
      org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:123)
      org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:472)
      org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:171)
      org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:99)
      org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:953)
      org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:118)
      org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:408)
      org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1008)
      org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:589)
      org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:310)
      java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
      java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
      java.lang.Thread.run(Unknown Source)
  </code></pre>
  
  <p>I <em>think</em> it has something to do with the date input not being processed correctly and being set into my exam data member. I can pick a date from the drop down and select it but even if i input an invalid date such as 23/11/51325 it still allows me to submit and gives me the same error. Maybe it's a mismatch of format between my Date variable and the input?</p>