Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

JSP Translation Phase  RSS feed

 
Ratheesh Narayanan
Ranch Hand
Posts: 38
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi all,

I had this question in my mind for a long time and I was trying to find out the answer, since I couldn't get a clear answer yet, let me ask you..

We all know that the JSP will not be translated to Servlet for each request; whenever there is a change(modification) in JSP page, to reflect that change the JSP engine re-creates the Servlet.

The question:
How JSP Engine understand there is a change(modification) in the JSP file?

Is there any comparison or cross-check happening between the JSP and its Servlet?

If yes will it happen on each requst?, so how fast it is, when there is, say, 1000 lines of script code in JSP?


Thanks in advance..

Ratheesh
 
Rao Raghu
Ranch Hand
Posts: 100
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The container checks for the Time-stamp of the JSP.If it is more recent that its generated servlet, then it recompiles the jsp into servlet and hence the changes appear.That is why when you make even slight change in a jsp,the page takes time to load.
 
Ratheesh Narayanan
Ranch Hand
Posts: 38
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Raghu,

And I found that most JSP containers support configuring how often the container checks JSP file timestamps to see if the page has changed.
So we can put a short intervel of seconds or minutes in a development environment and long intervel(may be never) on a production environment.

That was a great and very helpful answer you gave.. Thanks a lot..

Ratheesh
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!