I have 2 jsp pages in my Struts application. Each shows data according to the some forward from the actionClass. But sometimes, if the data is shown in A.jsp, the data in B.jsp does not get cleared up, which is from the previous condition. session.invalidate() does not work, because it clears the data of that page anyways. I want to control whether or not i want to refresh the page in the other jsp. So may be I can set some parameter in the actionclasses which controls wheher the particular jsps are to be cleared of any prev data. I hope I have explained myself clearly.
Are you using form beans?If yes,did you add reset method to it?
Joined: Aug 27, 2007
Previously I was using form beans and had a reset method. But now I am putting simple string data in the jsp page which I set in an action with a session variable. This is because there were some problem showing transformed XML to HTML data with bean. So there is no reset method(I was facing this prob even when i was using a bean and the reset methods).
Anyways, so the problem is that the individual jsps are not getting refreshed as it is the other jsp that is showing the data and this once does not know about it. There has to be some mechanism in jsp which polls a particular vaiable at regular intervals, and whenever the variable is set to true the page should refreshed. That variable might be set in the action class.
Joined: Aug 31, 2007
Hi Let me put to words what i understand from your problem statement: You set some attributes in the request/session object which you retrieve and display on the JSP.Now you say that the page is already loaded(ie, values last set before loading the page are displayed) and then in the Action, you again set some other values to the same attributes and you want the already loaded JSP to display these values, is it right? If so, you do need a polling mechanism to show it(think in lines of Ajax).But I find it difficult to understand how you expect it to show the values without reloading the page(or part of it).Will keep you informed if I come across something that may help.Confirm if I have understood your problem properly.
subject: Problem clearing previous data in jSP(Struts app)