This week's book giveaway is in the Java 9 forum.
We're giving away four copies of Java 9 Modularity: Patterns and Practices for Developing Maintainable Applications and have Sander Mak & Paul Bakker on-line!
See this thread for details.
Win a copy of Java 9 Modularity: Patterns and Practices for Developing Maintainable Applications this week in the Java 9 forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Regarding modification of jsp file.  RSS feed

 
Chinmaya Chowdary
Ranch Hand
Posts: 437
Java Oracle
  • 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: 437
Java Oracle
  • 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!
 
Don't get me started about those stupid light bulbs.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!