• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Deployed Servlet and Jsp

 
AmitVijay AVKulkarni
Greenhorn
Posts: 17
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator


Dear all,

A web application with Jsp and Servlet is deployed in Tomcat. And we start accessing that application through web browser. After this if we make any change in servlet and redeploy that new servlet, then we have restart Tomcat to see the changed servlet. But if we make any changes to Jsp we dont have to restart Tomcat. Why is so? Means behind the scene, jsp is translated to servlet and this servlet is catering to requests sent by client.

So can anybody kindly throw a light on this .

Amit
 
Osama Hasan
Ranch Hand
Posts: 53
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It is so because for each request,the JSP engine checks the timestamps of the source JSP page and the corresponding servlet class file to determine if the JSP page is new or if it has already been converted into a class file. However, no such check occurs for a servlet. This is why when we access a modified JSP, the JSP engine re-translates it,re-compiles it and then creates a new instance.
Hope it helps.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic