Hello again. Still having problems with this one. The page displays the default values, but when I submit, the updated values aren't getting copied into the session form bean.

If I remove the <s:push> tag and just reference each field independently it works ok. But when <s:push> is added back into the JSP, it no longer copies the values.

Any ideas?

<s:form action="sample" method="post">
   <s:push value="formBean">
      <s:textfield name="firstName" label="First Name" size="16" />
      <s:textfield name="maxValue" label="Max Value" size="10" />
      <s:submit method="submit" />
   </s:push>
</s:form>



@Results(
{
@Result(name = SampleAction.DISPLAY_FORM_PAGE, value = "/formDetails.jsp")
})
public class SampleAction extends ActionSupport implements SessionAware
{
   final static String DISPLAY_FORM_PAGE = "displayFormPage";
   private Map<String, Object> sessionMap = null;

   public void setSession(Map<String, Object> session)
   {
      sessionMap = session;
      if (!session.containsKey("formBean"))
      {
         setFormBean(new MyFormBean());
      }
   }

   public void setFormBean(MyFormBean formBean)
   {
      sessionMap.put("formBean", formBean);
   }

   public MyFormBean getFormBean()
   {
      return (MyFormBean)sessionMap.get("formBean");
   }

   public String displayForm() throws Exception
   {
      return DISPLAY_FORM_PAGE;
   }

   public String submit() throws Exception
   {
      return DISPLAY_FORM_PAGE;
   }
}


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to