M Sach
M Sach

Reputation: 34424

JSP life cycle when two request come after some time difference?

is the jspdestroy method is called only once during the life cycle of jsp like in sevlet?

say one request comes for JSP1. After 10 minutes another request comes for the same jsp. What will be the life cycle of JSP1 in aboce scenario. I mean will jspinit, jspservice,jspdestroy method be called for each request?

Upvotes: 0

Views: 186

Answers (1)

Basanth Roy
Basanth Roy

Reputation: 6500

The callback methods won't be called for each request. It will be called only once by the servlet container when the servlet is being loaded; and when the servlet is being destroyed. There is only one instance of the servlet at any given time. Each request starts a new thread.

Upvotes: 2

Related Questions