R
Rico
I'm kind of puzzled here.
For
<jsp:useBean id="obj" scope="session" class="obj.XX" />
<jsp:setProperty name="obj" property="*" />
After some requests, obj.total = 7000
I have a 'New obj' button that I am counting on to reset certain values
and reload the current page in which there's the following code:
System.out.println("1 - Value of obj.total=" + obj.total);
obj = new XX();
System.out.println("2 - Value of obj.total=" + obj.total);
As expected, output is:
1 - Value of obj.total=7000
2 - Value of obj.total=0 // reset in constructor
But if I click 'New obj' button right away again, I don't get
1 - Value of obj.total=0
2 - Value of obj.total=0
but
1 - Value of obj.total=7000
2 - Value of obj.total=0
How can this be? Has the constructor call not been committed to the
session scope when I did "obj = new XX();" ?
Do I have to clear the properties in a dedicated method then?
Rico.
For
<jsp:useBean id="obj" scope="session" class="obj.XX" />
<jsp:setProperty name="obj" property="*" />
After some requests, obj.total = 7000
I have a 'New obj' button that I am counting on to reset certain values
and reload the current page in which there's the following code:
System.out.println("1 - Value of obj.total=" + obj.total);
obj = new XX();
System.out.println("2 - Value of obj.total=" + obj.total);
As expected, output is:
1 - Value of obj.total=7000
2 - Value of obj.total=0 // reset in constructor
But if I click 'New obj' button right away again, I don't get
1 - Value of obj.total=0
2 - Value of obj.total=0
but
1 - Value of obj.total=7000
2 - Value of obj.total=0
How can this be? Has the constructor call not been committed to the
session scope when I did "obj = new XX();" ?
Do I have to clear the properties in a dedicated method then?
Rico.