• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Multiple User problem

 
karthik manick
Ranch Hand
Posts: 53
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi, I created a simple application using JSPs and servlets. Using the IP address in URL, multiple users can login to my application.
When a user logs in to the application, it will browse the database using login id and displays the details in home page.
When the 2nd users logs into the applcation, he is also getting the same details of the 1st user. It looks like, its not browsing again and is showing thesssion values from 1st user.
Please help me in resolving this..
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 65124
91
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The most likely cause of such problems is using scriptlet declarations in a JSP -- bad idea, there should be no Java code in modern JSPs at all -- or using instance variables in a servlet.

Check your app for Java code in JSPs. Any you find should be refactored into Java classes.

Check your servlets for instance variables. A single servlet instance serves multiple threads and so must be written to be thread-safe.
 
karthik manick
Ranch Hand
Posts: 53
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thans a lot Bear.. This issue got resolved once i changed the instance variables to local variables.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic