This week's book giveaway is in the OCAJP 8 forum. We're giving away four copies of OCA Java SE 8 Programmer I Study Guide and have Edward Finegan & Robert Liguori on-line! See this thread for details.
Hi, I've an application which have aroud 800 JSP files which accesses around 800 beans.(approx 3-5 beans per page). At present the scope of the beans given by us is "page". So everytime the different JSP page is requested, which uses beans which were used previously used, it garbage collects the previous instance and creates a new one. What if I make the scope of all the beans as "session" and use it across most of JSPs with the same ID. Will this approach improve the performance? And also will all the requests(for different JSPs) will be using the same instance of Bean and if yes, whether it will be syncronized? And does client has to wait if the instance is already in use? Thanks in advance shikhar
Joined: Oct 02, 2000
Can somebody pl help me on this issue. Thxs Shikhar
If you make the scope of the bean "session", it will hang around between request/response cycles instead of being destroyed after each page. The only way I can imagine a conflict over a session bean would be if a user has two requests in action (such as from a frame) as I understand it, you would have to handle any synchronization in the bean. Bill