Example & Tutorial understanding programming in easy ways.

Is JSP variable declaration thread safe?

No. The declaration of variables in JSP is not thread-safe, because the declared variables end up in the generated Servlet as an instance variable, not within the body of the _jspservice() method.
 The following declaration is not thread safe: because these are declarations, and will only be evaluated once when the page is loaded
 <%! int a = 6 %>
 The following declaration is thread safe: because the variables declared inside the scriplets have the local scope and not shared.
 <% int a = 6 %>;

Read More →
R4R Team
R4Rin Top Tutorials are Core Java,Hibernate ,Spring,Sturts.The content on R4R.in website is done by expert team not only with the help of books but along with the strong professional knowledge in all context like coding,designing, marketing,etc!