I have like following jsp
.I send some data via form and execute Action
,
case.jsp
before action:${CasePostFormBean.subject}
<s:action var="ServletHelperAction" name="login-user-to-bean" namespace="/servlet-helper"></s:action>
after action:${CasePostFormBean.subject}
<input name="CasePostFormBean.subject" value="${CasePostFormBean.getSubject()}" form="formCasePost">
<form method="post" id="formCasePost" submit="case-create"></form>
servlethelper.jsp
<html></html>
CasePostAction.java
public class CasePostAction extends ActionSupport implements SessionAware {
@Getter @Setter
private CasePostFormBean casePostFormBean = new CasePostFormBean();
@Action(value = "case-create", results = {
@Result(location = "case.jsp")
})
public String register() {
this.casePostFormBean.setSubject("success to send form");
return SUCCESS;
}
}
}
public class ServletHelperAction extends ActionSupport implements SessionAware {
// Beans
@Getter @Setter
private UserParamsBean userParamsBean = new UserParamsBean();
@Action(value = "login-user-to-bean", results = {
@Result(location = "servlethelper.jsp")
})
public String loginUserToBean() {
final MstUserModel mstUserModel = new MstUserModel(this.dbManager.getSqlSession());
if (this.session.get("userParamsBean.userCode") != null) {
this.userParamsBean.setUserCode(this.session.get("userParamsBean.userCode").toString());
Map<String, Object> loginUser = mstUserModel.selectUserOne(1, this.userParamsBean.getUserCode()).get(0);
this.userParamsBean.setUserName(loginUser.get("name").toString());
}
return SUCCESS;
}
}
After input input value
and after button submitted, like following was shown.
before action: success to send form
after action: input value
Out put is like follows, When I execute another action via <s:action>
the value stack seems to be changed.
Seems that after <s:action>
these sent data was recaptured by value stack.
My desired result is like
before action: success to send form
after action: success to send form
What is the root cause of this?