title: push value error in CRUD application
body: <p>I'm working on CRUD application where I'm supposed to design multiple forms. I'm trying to model the application based on example available <a href="http://www.tutorials4u.net/struts2-tutorial/struts2_crud_example.html" rel="nofollow">here</a>.
  I was able to design first form without any issues. But I'm facing following error for second form </p>
  
  <pre><code>type Exception report
  message An exception occurred processing JSP page /ctsFrmCaseStage.jsp at     line 22
  description The server encountered an internal error that prevented it from    fulfilling this request.
  exception
  org.apache.jasper.JasperException: An exception occurred processing JSP page     /ctsFrmCaseStage.jsp at line 22
  19: &lt;/head&gt;
  20: &lt;body&gt;
  21: &lt;s:form action="saveOrUpdateCaseStage"&gt;
  22:     &lt;s:push value="casestage"&gt;
  23:         &lt;s:hidden name="ccs_ID" /&gt;
  24:         &lt;s:textfield name="ccs_CaseStageName" label="CaseStage Name" /&gt;
  25:                 &lt;s:textfield name="ccs_Description" label="Description"   /&gt;
  
  root cause
  
  tag 'push', field 'value': You must specify a value to push on the stack.   Example: person - [unknown location]
  org.apache.struts2.components.Component.fieldError(Component.java:230)
  org.apache.struts2.components.Component.findValue(Component.java:351)
  org.apache.struts2.components.Push.start(Push.java:128)
  org.apache.struts2.views.jsp.ComponentTagSupport.doStartTag(ComponentTagSupp    ort.java:53)
  </code></pre>
  
  <p>I took following steps to design this form - 
  1) CaseStage.Java this is my domain object
  2) CaseStageDAO - interface
  3) CaseStageDAOImpl -  has four methods to perform the various CRUD operations.
  4) CaseStageAction - implements model driven interface
  5) ctsFrmCaseStage.jsp - jsp form
  Once this was done - I also included CaseStage class in hibernate.cfg.xml Mappings section. 
  I'd like to know what I've missed... please note I'm very new to struts and hibernate world. Thank you very much in advance
  Following is the code in sequence from all </p>
  
  <p>CaseStage.java </p>
  
  <pre><code>package com.tutorials4u.domain;
  import javax.persistence.Column;
  import javax.persistence.Entity;
  import javax.persistence.GeneratedValue;
  import javax.persistence.Id;
  import javax.persistence.Table;
  import java.util.Date;
  
  @Entity
  @Table(name = "mcasecategory")
  public class CaseStage {
  private Long ccs_ID;
  private int ccs_StageName, ccs_Description;
  
  @Id
  @GeneratedValue
  @Column(name = "ccs_ID") 
  public Long getCcs_ID() {
      return ccs_ID;
  }
  
  public void setCcs_ID(Long ccs_ID) {
      this.ccs_ID = ccs_ID;
  }
  
  @Column(name = "ccs_StageName")
  public int getCcs_StageName() {
      return ccs_StageName;
  }
  
  public void setCcs_StageName(int ccs_StageName) {
      this.ccs_StageName = ccs_StageName;
  }
  
  @Column(name = "ccs_Description")
  public int getCcs_Description() {
      return ccs_Description;
  }
  
  public void setCcs_Description(int ccs_Description) {
      this.ccs_Description = ccs_Description;
  }
  
  
  }
  </code></pre>
  
  <p>CaseStage.DAO</p>
  
  <pre><code>package com.tutorials4u.dao;
  import java.util.List;
  
  import com.tutorials4u.domain.CaseStage;
  
  
  public interface CaseStageDAO {
  public List&lt;CaseStage&gt; listCaseStage();
  public void saveOrUpdateCaseStage(CaseStage casestage);
  public CaseStage listCaseStageById(Long casestageId);
  public void deleteCaseStage(Long casestageId);
  }
  </code></pre>
  
  <p>CaseStageDAOImpl.java</p>
  
  <pre><code>package com.tutorials4u.dao;
  import java.util.List;
  
  import org.hibernate.Session;
  import org.hibernate.Transaction;
  
  import com.googlecode.s2hibernate.struts2.plugin.annotations.SessionTarget;
  import com.googlecode.s2hibernate.struts2.plugin.annotations.TransactionTarget;
  import com.tutorials4u.domain.CaseStage;
  
  
  public class CaseStageDAOImpl implements CaseStageDAO {
  @SessionTarget
  Session session;
  
  @TransactionTarget
  Transaction transaction;
  
      /**
   * Used to save or update a casestage.
   */
  @SuppressWarnings("unchecked")
  public List&lt;CaseStage&gt; listCaseStage() {
      List&lt;CaseStage&gt; courses = null;
      try {
          courses = session.createQuery("from CaseStage").list();
      } catch (Exception e) {
          e.printStackTrace();
      }
      return courses;
  }
  
      public void saveOrUpdateCaseStage(CaseStage casestage) {
      try {
          session.saveOrUpdate(casestage);
      } catch (Exception e) {
          transaction.rollback();
          e.printStackTrace();
      }
  }
  
      /**
   * Used to delete a user.
   */
  public void deleteCaseStage(Long casestageId) {
      try {
          CaseStage casestage = (CaseStage) session.get(CaseStage.class, casestageId);
          session.delete(casestage);
      } catch (Exception e) {
          transaction.rollback();
          e.printStackTrace();
      } 
  }
  
  /**
   * Used to list all the users.
   */
  
  /**
   * Used to list a single user by Id.
   */
  public CaseStage listCaseStageById(Long casestageId) {
      CaseStage casestage = null;
      try {
          casestage = (CaseStage) session.get(CaseStage.class, casestageId);
      } catch (Exception e) {
          e.printStackTrace();
      }
      return casestage;
  }
  }
  </code></pre>
  
  <p>CaseStageAction.java</p>
  
  <pre><code>package com.tutorials4u.web;
  
  import static com.opensymphony.xwork2.Action.SUCCESS;
  import java.util.ArrayList;
  import java.util.List;
  
  import javax.servlet.http.HttpServletRequest;
  
  import org.apache.struts2.ServletActionContext;
  
  import com.opensymphony.xwork2.ActionContext;
  import com.opensymphony.xwork2.ActionSupport;
  import com.opensymphony.xwork2.ModelDriven;
  import com.tutorials4u.dao.CaseStageDAO;
  import com.tutorials4u.dao.CaseStageDAOImpl;
  import com.tutorials4u.domain.CaseStage;
  
  public class CaseStageAction extends ActionSupport implements ModelDriven&lt;CaseStage&gt; {
  
  private static final long serialVersionUID = -6659925652584240539L;
  
  private CaseStage casestage = new CaseStage();
  private List&lt;CaseStage&gt; casestageList = new ArrayList&lt;CaseStage&gt;();
  private CaseStageDAO casestageDAO = new CaseStageDAOImpl();
  
  public CaseStage getModel() {
      return casestage;
  }
  
  /**
   * To save or update casestage.
   * @return String
   */
      public String saveOrUpdate()
  {   
      casestageDAO.saveOrUpdateCaseStage(casestage);
      return SUCCESS;
  }
  
  /**
   * To list all categories.
   * @return String
   */
  public String list()
  {
      casestageList = casestageDAO.listCaseStage();
      return SUCCESS;
  }
  
  /**
   * To delete a casestage.
   * @return String
   */
      public String delete()
  {
      HttpServletRequest request = (HttpServletRequest) ActionContext.getContext().get(ServletActionContext.HTTP_REQUEST);
      casestageDAO.deleteCaseStage(Long.parseLong(request.getParameter("ccs_ID")));
      return SUCCESS;
  }
  /**
   * To list a single casestage by Id.
   * @return String
   */
      public String edit()
  {
      HttpServletRequest request = (HttpServletRequest) ActionContext.getContext().get(ServletActionContext.HTTP_REQUEST);
      casestage = casestageDAO.listCaseStageById(Long.parseLong(request.getParameter("ccs_ID")));
      return SUCCESS;
  }
  
  public CaseStage getCaseStage() {
      return casestage;
  }
  
  public void setCaseStage(CaseStage casestage) {
      this.casestage = casestage;
  }
  
  public List&lt;CaseStage&gt; getCaseStageList() {
      return casestageList;
  }
  
  public void setCaseStageList(List&lt;CaseStage&gt; casestageList) {
      this.casestageList = casestageList;
  }
  
  }
  </code></pre>
  
  <p>ctsFrmCaseStage.jsp</p>
  
  <pre><code>&lt;%@ page language="java" contentType="text/html; charset=ISO-8859-1"
  pageEncoding="ISO-8859-1"%&gt;
  &lt;!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"   "http://www.w3.org/TR/html4/loose.dtd"&gt;
  &lt;%@taglib uri="/struts-tags" prefix="s"%&gt;
  &lt;html&gt;
  &lt;head&gt;
  &lt;meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"&gt;
  &lt;title&gt;Registration Page&lt;/title&gt;
  &lt;s:head /&gt;
  &lt;style type="text/css"&gt;
  @import url(style.css);
  &lt;/style&gt;
  &lt;/head&gt;
  &lt;body&gt;
  &lt;s:form action="saveOrUpdateCaseStage"&gt;
  &lt;s:push value="casestage"&gt;
      &lt;s:hidden name="ccs_ID" /&gt;
      &lt;s:textfield name="ccs_CaseStageName" label="CaseStage Name" /&gt;
              &lt;s:textfield name="ccs_Description" label="Description" /&gt;
  
              &lt;s:submit /&gt;
  &lt;/s:push&gt;
  &lt;/s:form&gt;
  
  &lt;s:if test="casestageList.size() &gt; 0"&gt;
  &lt;div class="content"&gt;
  &lt;table class="userTable" cellpadding="5px"&gt;
      &lt;tr class="even"&gt;
          &lt;th&gt;CaseStage Name&lt;/th&gt;
          &lt;th&gt;Description&lt;/th&gt;
  
  
      &lt;/tr&gt;
      &lt;s:iterator value="casestageList" status="casestageStatus"&gt;
          &lt;tr
              class="&lt;s:if test="#casestageStatus.odd == true "&gt;odd&lt;/s:if&gt;  &lt;s:else&gt;even&lt;/s:else&gt;"&gt;
              &lt;td&gt;&lt;s:property value="ccs_CaseStageName" /&gt;&lt;/td&gt;
              &lt;td&gt;&lt;s:property value="ccs_Description" /&gt;&lt;/td&gt; 
  
                              &lt;td&gt;&lt;s:url id="editURL" action="editCaseStage"&gt;
                                      &lt;s:param name="ccs_ID" value="%{ccs_ID}"&gt;&lt;/s:param&gt;
              &lt;/s:url&gt; &lt;s:a href="%{editURL}"&gt;Edit&lt;/s:a&gt;&lt;/td&gt;
              &lt;td&gt;&lt;s:url id="deleteURL" action="deleteCaseStage"&gt;
                  &lt;s:param name="ccs_ID" value="%{ccs_ID}"&gt;&lt;/s:param&gt;
              &lt;/s:url&gt; &lt;s:a href="%{deleteURL}"&gt;Delete&lt;/s:a&gt;&lt;/td&gt;
          &lt;/tr&gt;
      &lt;/s:iterator&gt;
  &lt;/table&gt;
  &lt;/div&gt;
  &lt;/s:if&gt;
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>Category.java</p>
  
  <pre><code>package com.tutorials4u.domain;
  
  import javax.persistence.Column;
  import javax.persistence.Entity;
  import javax.persistence.GeneratedValue;
  import javax.persistence.Id;
  import javax.persistence.Table;
  import java.util.Date;
  
  @Entity
  @Table(name = "cts_mcasecategory")
  public class Category {
  
  private Long ccg_ID;
  private int ccg_CreateUser, ccg_ModifyUser;
  private String ccg_CategoryName;
  private String ccg_Description;
  private Date ccg_CreateDate, ccg_ModifyDate;
  private boolean ccg_DeleteFlag, ccg_ActiveFlag;
  
  @Id
  @GeneratedValue
  @Column(name = "ccg_ID")    
  public Long getCcg_ID() {
      return ccg_ID;
  }
  
  public void setCcg_ID(Long ccg_ID) {
      this.ccg_ID = ccg_ID;
  }
  
  @Column(name = "ccg_CategoryName")    
  public String getCcg_CategoryName() {
      return ccg_CategoryName;
  }
  
  public void setCcg_CategoryName(String ccg_CategoryName) {
      this.ccg_CategoryName = ccg_CategoryName;
  }
  
  @Column(name = "ccg_Description")    
  public String getCcg_Description() {
      return ccg_Description;
  }
  
  public void setCcg_Description(String ccg_Description) {
      this.ccg_Description = ccg_Description;
  }
  
  @Column(name = "ccg_CreateUser")
  public int getCcg_CreateUser() {
      return ccg_CreateUser;
  }
  
  public void setCcg_CreateUser(int ccg_CreateUser) {
      this.ccg_CreateUser = ccg_CreateUser;
  }
  
  @Column(name = "ccg_ModifyUser")
  public int getCcg_ModifyUser() {
      return ccg_ModifyUser;
  }
  
  public void setCcg_ModifyUser(int ccg_ModifyUser) {
      this.ccg_ModifyUser = ccg_ModifyUser;
  }
  
  @Column(name = "ccg_CreateDate")
  public Date getCcg_CreateDate() {
      return ccg_CreateDate;
  }
  
  public void setCcg_CreateDate(Date ccg_CreateDate) {
      this.ccg_CreateDate = ccg_CreateDate;
  }
  
  @Column(name = "ccg_ModifyDate")
  public Date getCcg_ModifyDate() {
      return ccg_ModifyDate;
  }
  
  public void setCcg_ModifyDate(Date ccg_ModifyDate) {
      this.ccg_ModifyDate = ccg_ModifyDate;
  }
  
  @Column(name = "ccg_DeleteFlag")
  public boolean isCcg_DeleteFlag() {
      return ccg_DeleteFlag;
  }
  
  public void setCcg_DeleteFlag(boolean ccg_DeleteFlag) {
      this.ccg_DeleteFlag = ccg_DeleteFlag;
  }
  
  @Column(name = "ccg_ActiveFlag")
  public boolean isCcg_ActiveFlag() {
      return ccg_ActiveFlag;
  }
  
  public void setCcg_ActiveFlag(boolean ccg_ActiveFlag) {
      this.ccg_ActiveFlag = ccg_ActiveFlag;
  }
  }
  </code></pre>
  
  <p>Hibernate config </p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  &lt;!DOCTYPE hibernate-configuration PUBLIC "-//Hibernate/Hibernate Configuration DTD 3.0//EN" "http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd"&gt;
  &lt;hibernate-configuration&gt;
  &lt;session-factory&gt;
  &lt;property name="hibernate.connection.driver_class"&gt;com.mysql.jdbc.Driver&lt;/property&gt;
  &lt;property name="hibernate.connection.url"&gt;jdbc:mysql://localhost:3306/case_tracking_system    &lt;/property&gt;
  &lt;property name="hibernate.connection.username"&gt;root&lt;/property&gt;
  &lt;property name="connection.password"&gt;nvj@123&lt;/property&gt;
  &lt;property name="connection.pool_size"&gt;1&lt;/property&gt;
  &lt;property name="hibernate.dialect"&gt;org.hibernate.dialect.MySQLDialect&lt;/property&gt;
  &lt;property name="show_sql"&gt;true&lt;/property&gt;
  &lt;property name="hbm2ddl.auto"&gt;create&lt;/property&gt;
  &lt;mapping class="com.tutorials4u.domain.User"/&gt;
  &lt;mapping class="com.tutorials4u.domain.Category"/&gt;
  &lt;mapping class="com.tutorials4u.domain.CaseStage"/&gt;
  &lt;/session-factory&gt;
  &lt;/hibernate-configuration&gt;
  </code></pre>
  
  <p>Struts.xml</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  &lt;!DOCTYPE hibernate-configuration PUBLIC "-//Hibernate/Hibernate   Configuration DTD 3.0//EN" "http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd"&gt;
  &lt;hibernate-configuration&gt;
  &lt;session-factory&gt;
  &lt;property name="hibernate.connection.driver_class"&gt;com.mysql.jdbc.Driver&lt;/property&gt;
  &lt;property name="hibernate.connection.url"&gt;jdbc:mysql://localhost:3306/case_tracking_system    &lt;/property&gt;
  &lt;property name="hibernate.connection.username"&gt;root&lt;/property&gt;
  &lt;property name="connection.password"&gt;nvj@123&lt;/property&gt;
  &lt;property name="connection.pool_size"&gt;1&lt;/property&gt;
  &lt;property name="hibernate.dialect"&gt;org.hibernate.dialect.MySQLDialect&lt;/property&gt;
  &lt;property name="show_sql"&gt;true&lt;/property&gt;
  &lt;property name="hbm2ddl.auto"&gt;create&lt;/property&gt;
  &lt;mapping class="com.tutorials4u.domain.User"/&gt;
  &lt;mapping class="com.tutorials4u.domain.Category"/&gt;
  &lt;mapping class="com.tutorials4u.domain.CaseStage"/&gt;
  &lt;/session-factory&gt;
  &lt;/hibernate-configuration&gt;
  </code></pre>