I have a jsp page with 2 iframes on the page which both call the same servlet with different parameters. When I load each Iframe individually, the servlet loads properly, but when the browser window is refreshed -- loading both Iframes simultaneously, Strings values which are set based on the servlet's input parameter, switch servlets. This switch happens when the servlet attempts to connect to the database.
For example, I pass String A to servlet 1, and String B to servlet 2. When both Iframes are loaded together, I println on Servlet 1 and the String A = String A initially. After a DB call is made in Servlet 1 String A = String B from Servlet 2. Wierd.
It's as though there's one single thread for both servlets and they're confusing the data. I can get around the problem by giving the servlets different names, but I am curious to know why this is happenning in the first place.
Thanks for any advice anyone can offer.