You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@struts.apache.org by bu...@apache.org on 2005/02/01 11:28:46 UTC
DO NOT REPLY [Bug 33326] New: -
Strange value exchange between two formbeans.
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG�
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=33326>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND�
INSERTED IN THE BUG DATABASE.
http://issues.apache.org/bugzilla/show_bug.cgi?id=33326
Summary: Strange value exchange between two formbeans.
Product: Struts
Version: 1.1 Final
Platform: PC
OS/Version: Windows XP
Status: NEW
Severity: minor
Priority: P2
Component: Unknown
AssignedTo: dev@struts.apache.org
ReportedBy: nieke@softenergy.de
Hello all,
i have observed a strange situation. If i do an ActionForward from SampleAction1
to SampleAction2 the formbean related to each Action exchange the values of the
attributes that has the same name in both formbeans.
example:
// SampleAction1 / SampleForm1
public final class SampleAction1 extends Action {
public ActionForward execute(
ActionMapping mapping,
ActionForm form,
HttpServletRequest request,
HttpServletResponse response)
throws Exception {
HttpSession session = request.getSession();
SampleForm1 myForm = (SampleForm1) form;
myForm.setSample("test");
return new ActionForward ("/sample2.do");
}
public final class SampleForm1 extends ValidatorForm {
private String sample = null;
// RESET
public void reset(ActionMapping mapping, HttpServletRequest request) {
sample = null;
}
// GETTER / SETTER
//...
}
// SampleAction2 / SampleForm2
public final class SampleAction2 extends Action {
public ActionForward execute(
ActionMapping mapping,
ActionForm form,
HttpServletRequest request,
HttpServletResponse response)
throws Exception {
HttpSession session = request.getSession();
SampleForm2 myForm = (SampleForm2) form;
// ATTENTION
// Now the value of sample in myForm(SampleForm2) is
// "test"
return new ActionForward ("/end.do");
}
public final class SampleForm2 extends ValidatorForm {
private String sample = null;
// RESET
public void reset(ActionMapping mapping, HttpServletRequest request) {
sample = null;
}
// GETTER / SETTER
//...
}
Although the reset() methode of SampleForm2 is called (i set a breakpoint) the
value of the attribute sample is anyway "test" after the framework enters the
method execute() of SampleAction2.
--
Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@struts.apache.org
For additional commands, e-mail: dev-help@struts.apache.org