Implication of scope and variables in JSP
I found out the hard way that using instance variables in JSP will inadvertently share data among different concurrent users. And when this data comes from a JDBC query which is specific to a user, it causes problems.
One way around this is to declare the page not thread-safe (isThreadSafe=false), but this is not recommended because it introduces latency.
I retrieve data from a JDBC bean with a scope of page, so I think there are no concurrency issues with the bean. However, the page that calls the bean passes some variables, some of which are arrays, when calling the bean.
I have been able to place most of this variable data in session variables, but there are some that I have not been able to do this with. Arrays, for example. I don't know how to initialize an array as a session variable and then access the individual array elements (still as a session variable) to place data in them.
While these seem to be my only two options (declaring page not threadsafe or using session variables exclusively) I also think it's possible that I'm completely confused on this and maybe I'm making this too complicated. Any discussion that would amplify this topic would be appreciated.
Thanks,
Glenn

