When did jsp is actually loaded (at startup or first request)as we have this option for servlets. If its at first request then how does server knows that this is the first request.
Asked
Active
Viewed 79 times
1 Answers
1
When did jsp is actually loaded (at startup or first request)
On first request. It's however also possible to let the server send a request to itself on startup. Alternatively, you could precompile JSPs during build before deploy. See for details also the following related questions:
- How can I make Tomcat pre-compile JSPs on startup?
- Is it possible to precompile jsp into eclipse?
- What is the best way to precompile JSPs using Ant
If its at first request then how does server knows that this is the first request.
When there's no compiled JSP class available in server's memory. So it does not exactly check if the request is a first request, but just if the requested JSP is already compiled.
-
thaks for that but what happens when we make some changes to our existing jsp then how did server identify that its a new jsp which needs to be compiled again as what I think it already have one compiled to its memory – Sunny Apr 06 '13 at 17:38
-
The server would only do that if hotdeployment is enabled. It will then run a background task which scans the "last modified" time stamp of source code files and compares them against a mapping in memory. If changed, then it will be reloaded. – BalusC Apr 06 '13 at 17:51