It may dispel your above 2 doubts after you finding the Servlet source file generated from JSP.
In addition, the scriptlets and javacodes in JSP are already deprecated.
You can use new technologies instead of them completely now.
David Newton wrote:
Because there's only one instance of the JSP created, and it's shared across all requests.
As david said above, Servlet has the features which are singleton and multi-thread the same as JSP.
This means that there is one and only one instance of it in your own app and all requests access the same one.
The answer to my last question: by default, NO.
According to the Servlet specification, a servlet that does not declare SingleThreadModel usually has one and only one instance, shared among all concurrent requests hitting that servlet.