Win a copy of Kotlin in Action this week in the Kotlin forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

A few Quick questions..  RSS feed

 
Debashish Chakrabarty
Ranch Hand
Posts: 231
Firefox Browser Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
(1) How does the webserver decide when to recompile a JSP?
(2) Is it by the timestamp? If yes will this be true for all webservers or is this vendor-specific?
(3) Also how does the "reloadable" context property affect this decision of the webserver (to recompile)?
(4) And lastly in my deliverables (to customer) should this reloadable property be set to "false". Is there any disadvantage if it is kept "true"?
Thanks for your time ranchers.
 
Gary McGath
Ranch Hand
Posts: 52
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
According to Sun (http://java.sun.com/blueprints/qanda/web_tier/#reload):
"The JSP 1.1 specification does not require dynamic reloading (automatic recompile of modified JSP pages). Many servers cache compiled JSP pages in memory to improve performance, and require some explicit operation (such as an explicit reload, or even a server restart) to reload a changed page."
So you should never count on a page's being recompiled if it changes (or on its not being recompiled, for that matter). Also, Tomcat's server.xml file is vendor-specific, so its Context directives may not be the same as other vendors' directives.
 
L Brennan
Greenhorn
Posts: 23
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Don't know if this is any use to you use the following code to force the page to be recompiled each time:
response.setHeader("Cache-Control","no-cache"); //HTTP 1.1
response.setHeader("Pragma","no-cache"); //HTTP 1.0
response.setDateHeader ("Expires", 0); //prevents caching at the proxy server
 
Andy Bowes
Ranch Hand
Posts: 171
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Setting attributes on the Response Header does not force the recompile of the JSP pages it just prevents the page being cache in the client's browser cache. This means that the next time the client visits the URL the browser will be forced to send a request to the WebServer rather than just display the locally cached version.
As Gary stated there is no universal way to ensure that the JSP pages are being recompiled. Each vendor has their own settings.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!