Reliable Jsp Flow Value

JSP is thread safe by default, but what's the point when we say

JSP is thread safe

?

+3
source share
2 answers

When jsp is created, it becomes a servlet on the application server. All logic is executed from the jspService method, all links or variables that you have in jsp become local variables, so by default jsp can be considered thread-safe.

Check out the link to view the jsp life cycle.

In the end, all the code you have in jsp will be in the _jspService method. All the contents of your JSP will be inside.

public void _jspService(HttpServletRequest request,
HttpServletResponse response)
throws java.io.IOException, ServletException {
+2
source

JSP ! JSP , , ( ) . JSP? JSP:

<%! private Object notThreadSafe = new Object(); %>

(, JSP-).

JSP , JSP-. ( html/jsp, <% /* some code*/ %>, jsp <%= "some expression" %>,...) jspService, Koitoer.

+1

All Articles