I have a class
public class MyServlet extends HttpServlet {
...
private static MyObject myobject;
public static MyObject getMyObject(){
return myobject;
}
}
and a jsp in which I have
<%! MyObject my_jsp_object = MyServlet.getMyObject();%>
myobject has an initial status, which I can modify and save.
The problems occur when I modify myobject ON THE SERVER. I would expect that, if I modify myobject and then reload the jsp, my_jsp_object is modified too, but it isn't.
Where am I wrong? How can I obtain this behaviour? Thanks
EDIT
For the sake of clarity, this is the behaviour I would like to obtain
- Start the server
- Get the jsp with the initial value of myobject stored in my_jsp_object
- Someone somewhere someway modify myobject
- When i reload the jsp, I have the new value of myobject stored in my_jsp_object
Until now, when i reload the jsp, I still have the old value of myobject stored in my_jsp_object