No, in JSP the variable declaration is not at all thread safe as the declared variables are ended up as instance variable in generated servlet not in body of _jspservice() method. The given declaration is not considered to be thread safe: as they are declarations and are evaluated only one time when page gets loaded. <%!int a=5;%> The given declaration is considered thread safe: as in the scriplets the variables that have been declared are not shared ...
License4J 4.0
Yesterday, 12:23 AM in Java Software