Here are some examples of how I am accessing the session pojo fields on
my form:
<s:form action="Sample!submit" method="post" >
<s:checkbox name="#session.formBean.requeryInfo" label="Requery
Info?" />
<s:textfield name="#session.formBean.firstName"
value="%{#session.formBean.firstName}" label="First Name" size="16" />
<!-- etc -->
</s:form>
and then in my action class (SampleAction):
public String showForm() throws Exception
{
MyFormBean formBean = new MyFormBean();
Map session = (Map)ActionContext.getContext().get("session");
session.put("formBean",formBean);
return ("showFormPage");
}
public String submit() throws Exception
{
Map session = (Map)ActionContext.getContext().get("session");
MyFormBean formBean = (MyFormBean)session.get("formBean");
formBean.setMessage("submit was received and processed.");
return "showFormPage";
}
So when I set a break point in submit(), I can see that it is invoked,
but when I pull the "formBean" out of session I find that it is still
the unedited copy (original). Struts2 apparently has not copied the
form value into the pojo valueobj for me.
BTW - I am using "zero configuration" and struts2 2.1.2
Thanks.
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]