• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Decesion to compile JSP?

 
Ash Kondhalkar
Ranch Hand
Posts: 43
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

I have one doubt. Suppose I am running a dynamic web application on my machine. I have modified one of the jsp, and now I am trying to access this jsp from internet browser from application, how does server takes a decesion to compile this jsp???

Cheers
Ashwin
 
vidya sagar
Ranch Hand
Posts: 580
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Once you changed the JSP that is currently running,Container automatically knows(thru some mechanism thats is vendor dependent) and at next request it generates a update servlet file,compiles and execute the updated one.
 
Ash Kondhalkar
Ranch Hand
Posts: 43
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thank you for replying. Actually I was eager to know how the server understands that its time to recompile the JSP...
 
Ulf Dittmer
Rancher
Posts: 42967
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Most likely it looks at the last modified date of the JSP file. If that is later than the date on the class file, then it's time to recompile. Tomcat keeps the generated source and class files in the "work" directory.
 
Ash Kondhalkar
Ranch Hand
Posts: 43
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Actually I thought of the same solution. But then thought of one scenario where it will fail. If I back date my machine and then change a JSP and save it, then JSP timestamp will be older than its class file timestamp.... And this JSP will never be compiled.
 
Ulf Dittmer
Rancher
Posts: 42967
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Well, if you change the date on a machine, other things will stop working, too. CVS, e.g., looks at file timestamps as well. Tomcats JSP implementation does indeed break if you change the clock. But that's hardly a bug, more like a deliberate breakage.
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64715
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You could also blow the machine up with dynamite and it will stop working.
 
Ben Souther
Sheriff
Posts: 13411
Firefox Browser Redhat VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Bear Bibeault:
You could also blow the machine up with dynamite and it will stop working.


Is there a workaround for this bug?
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64715
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Ben Souther:


Is there a workaround for this bug?


Yes, it involves ablative armor and, optionally, force field technology.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic