aspose file tools*
The moose likes JSP and the fly likes Decesion to compile JSP? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Java » JSP
Bookmark "Decesion to compile JSP?" Watch "Decesion to compile JSP?" New topic
Author

Decesion to compile JSP?

Ash Kondhalkar
Ranch Hand

Joined: Jun 14, 2006
Posts: 43
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

Joined: Mar 02, 2005
Posts: 580
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

Joined: Jun 14, 2006
Posts: 43
Thank you for replying. Actually I was eager to know how the server understands that its time to recompile the JSP...
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 42286
    
  64
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.


Ping & DNS - my free Android networking tools app
Ash Kondhalkar
Ranch Hand

Joined: Jun 14, 2006
Posts: 43
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
Marshal

Joined: Mar 22, 2005
Posts: 42286
    
  64
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

Joined: Jan 10, 2002
Posts: 61433
    
  67

You could also blow the machine up with dynamite and it will stop working.


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
Ben Souther
Sheriff

Joined: Dec 11, 2004
Posts: 13410

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?


Java API J2EE API Servlet Spec JSP Spec How to ask a question... Simple Servlet Examples jsonf
Ben Souther
Sheriff

Joined: Dec 11, 2004
Posts: 13410

Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61433
    
  67

Originally posted by Ben Souther:


Is there a workaround for this bug?


Yes, it involves ablative armor and, optionally, force field technology.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Decesion to compile JSP?