This week's book giveaway is in the OCAJP forum. We're giving away four copies of OCA Java SE 8 Programmer I Study Guide 1Z0-808 and have Jeanne Boyarsky & Scott Selikoff on-line! See this thread for details.
Originally posted by seetharaman venkatasamy: Hi All,
if you put isThreadSafe="true" in your jsp..it is like implementing STM so it is discourage right?
i found this(isThreadSafe="true") in my jsp(project)... can i remove this?..when i try this i found no diffence!!! so what i have to do?
please can anyone explain me?
Yes, it is equivalent to the STM. The problem is that finding threading bugs is hard to do until your code is under heavy load. Once the code goes into production then they pop up easy enough :-(.
You have to scan through the JSP and make sure it isn't doing anything that isn't safe - like accessing static of instance variables (look for variables declared in <%! %> tags), and isn't using classes which use static or instance variables. Then double check any resources that the JSP and its helper classes use and make sure they are safely thread localized. Depending on the JSP this may be easy (if the JSP is for display only it should be easy) or hard (if you are doing a lot of work in the JSP).
Everything Steve said + Access to your session and application (context) scoped variables is not necessarily thread-safe either. You would have to examine any code that sets or reads these to make sure that you won't have any concurrency issues.