• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

jsp and java bean problem

 
Greenhorn
Posts: 17
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Ranch Hand
Posts: 128
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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,
 
Sheriff
Posts: 13411
Firefox Browser VI Editor Redhat
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Ranch Hand
Posts: 1514
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
yes my arraylist is instance variable, could you please explain me what is the problem here.
 
reply
    Bookmark Topic Watch Topic
  • New Topic