• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Regarding modification of jsp file.

 
Chinmaya Chowdary
Ranch Hand
Posts: 434
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi. If we send request(first) to jsp file, container translates it into .java file, compiles, loads the class file, instantiates, initializes, calls the service method and the response will be send to the client. All this happens for first request. If we use <load-on-stratup> all this happens during startup of container except calling service method.

For second request(if we use <load-on-startup> it is first request), container will just calls the service method and serves the client.
Later if any changes made to the jsp file, container detects that, and starts its life cycle again(translating, compiling, etc.).

My question is, how the container knows, there is a change in the jsp file, so i(container) have start the life cycle again? Thankyou.
 
Sebastian Janisch
Ranch Hand
Posts: 1183
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I don't know the exact algorithm, but I would guess it has a checksum of the JSP file and upon JSP request, it checks the checksum and then either forwards to the class file or retranslates the JSP. Maybe it's even simpler and the container just keeps the creation dates of the JSP files and checks those.
 
Chinmaya Chowdary
Ranch Hand
Posts: 434
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
That makes sense. Thankyou.
 
Nabila Mohammad
Ranch Hand
Posts: 664
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It's going all over the top of my head.. the question n answer!! Phewwww!
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic