Thread Safety in JSP & Servlet
Sunday, September 28th, 2008 | Author: Martin
You can thread safe your jsp (java server pages) pages in two ways
1. By implementing the SingleThreadModel interface.
This is done by adding the directive to your jsp page
<%@ page isThreadSafe=”false” %>
Within your jsp page.
When you implement SingleThreadModel interface instead of a single instance of the servlet generated for your jsp page loaded in memory, jsp engine creates new instance of that jsp page for each client request.
but avoid this method because, this methods has some performance issue and there are many pitfalls.
2. By using synchronized block or synchronized method
Category: Hosting Security, Java |
| Leave a Comment


