Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

jsp and java bean problem

 
shashank bezalwar
Greenhorn
Posts: 17
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
i have a jsp page to display information about various projects created by users. each user is able to see the projects created by him. i am using java bean to store the information of projects for particular user. but sometimes i get project information of other user and when i refresh the page i get my project details, can anyone please tell me what is the problem.
 
Khushwinder Chahal
Ranch Hand
Posts: 128
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Shashank bezalwar ,

From the very brief information provided by you i think you should look at
the query which is bringing the information about a particular user in your jsp.
If you want to discuss it more please tell how are you bringing values in your jsp from the back end.
Regards,
 
Ben Souther
Sheriff
Posts: 13411
Firefox Browser Redhat VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
As Khushwinder Chahal said, we need more details before we could give you any specific information.

Two things to look for:
Are you using instance variables in your servlets or JSPs?
Did you bind your bean to context (application) scope instead of session or request scope?
 
shashank bezalwar
Greenhorn
Posts: 17
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
i am using the bean in session scope.

this is the query i am using to fetch the project details:

sqlQuery = "SELECT * FROM projectgroups WHERE projectgroups.status ='In Progress' AND projectgroups.userId =userId;

here is my code for returning the information to the jsp



i am passing the arraylist to jsp page where i retrieve the information from arraylist.
 
shashank bezalwar
Greenhorn
Posts: 17
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
i am storing the user id in session variable, but when i get the information of other users the user id is correct but the values are of different user.
 
Bosun Bello
Ranch Hand
Posts: 1511
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Is the arraylist an instance variable? If so, that's probably the problem.
 
shashank bezalwar
Greenhorn
Posts: 17
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
yes my arraylist is instance variable, could you please explain me what is the problem here.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic