MY mENU


Wednesday 21 March 2012

implement a thread-safe JSP page


How can I implement a thread-safe JSP page? What are the advantages and Disadvantages of using it?

            You can make your JSPs thread-safe by having them implement the SingleThreadModel interface. This is done by adding the directive in the JSP.

<%@ page isThreadSafe="false" %>

The generated servlet can handle only one client request at time so that we can make JSP as thread safe. We can overcome data inconsistency problems by this approach. The main limitation is it may affect the performance of the system. 

No comments:

Post a Comment