How do I implement synchronization in JSP if I don't want to use SingleThreadModel interface?

Raghu Hemmige

The easiest way of making JSP pages thread safe is to ensure that the server side variables in your JSP page are defined within the jsp-service method, when it is translated into a servlet. This is possible if you define variablese within <% %>. Make sure that you dont use <%! %> , as this is used for defining class level variables of the servlet, which will obviously not be thread safe.