Disappearing data in request scope.
Hi, I am supporting a java web based application which is developed on SDF framework. there are 2 issues which I m facing most frequently in the application as:-
1. If we browse the application then sometime the Combo boxes are populated by blank values. Which should ideally filled up with the last request data. we are using the request scope in the application and the data of one page is shared to many pages in the application.
2.Suppose 3-4 user access the application simulteneoulsy and they browse the same screens from different machines then the data of one user is reflected to another user when they browse the pages. For example if one user has selected a value in the combo box then another user sees that values in their screens which they never select. Kindly suggest .
Is it happening due to bean persistance as the application bean is no where implementing the serialized interface.
Thanks In Adavance !!!!
You need to be more precise as to what "SDF framework" is.
1 isn't a question. I can only guess you don't want empty selections. Somewhere the GUI control allows you to select a default value. Determining the default value is up to you.
2 means that something is wrong in your code. Presumably you are using a server and something is being shared there which shouldn't be.
SDF is servlet development framework....we are using servlet as a controller.There is no static method in servlets.Actually I can say this is the problem of session data crossover.as i checked it that two users are getting the same bean reference which we put in session from our servlet.We are using the one application wide servlet in which we have defined the put and get methods for session. Now from each Jsp page we go to a servlet from where we obtain the object of this application wide servlet and put and get the session by those methods.
Is this all is happening because we are putting and getting the session object from a class which is used application wide?
Thanks.
Hi,
Make sure that you are putting the data in the session or not. Try to write the System.out.println(session.getId()) statements in the pages where your getting the values from the session. Actually It will not reflect the values if you are not having any static methods, variables. The session will be unique for every user. If you need furthur more help just send the code piece so that I will try to clarify your doubt.
Thanks & Regards,
Santhosh Reddy Mandadi.
Hi,I printed the bean reference id and it is being shared by multiple client. So suppose User1 have the bean reference 1 then the same reference 1 is seen to the user 2 which I think should be ideally different to each user. we put this bean in session to retain the screen data but now it seems that this bean is sharing with other users also.due to this other users are also seeing the data of user1 . we are not using any application scope.then why its happening?
Kindly suggest.
In our application we select some data in one screen and which is then used to many screens. So we keep the sceen data in a bean and put it to the session for further use.