Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Sticky servlet  RSS feed

 
Bob Young
Ranch Hand
Posts: 65
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Bear with me for another really green question. I made a html form and misspelled the servlet name in the ACTION attribute. As expected, I get a 404 error. I correct the spelling and run the form again, however it continues to give me the misspelled servlet name and the 404 error. I restart the server - it does the same. I reboot the computer - it does the same. I know the form works, just gave it a different name (with the correct spelling of the servlet) and it works. The server is remembering what is happening and not updating. How does one get the server to update? I am using Tomcat 4.0. I verfied that <DefaultContext reloadable = "true"> is in the correct section of the server.xml file. However I am under the impression that this is for changing class files. Any thoughts. Thanks.
 
Mike Curwen
Ranch Hand
Posts: 3695
IntelliJ IDE Java Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It's probably your browser cache. IE is the worst for this, because you can set it to never check the page again.

Tools | Internet Options | General tab | Temporary File Settings box | Settings button.

Make sure you have it set to 'every visit to the page'

You might also tell it to clear all the currently cached pages. That's the other button on the same dialog box.
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 65826
134
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
And you might also want to add the various "hints" you can add to your pages that do their best to tell the browsers not to cache your pages in the first place.
Use "search" to find quite a few threads in these forums that discuss just this.
bear
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 65826
134
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
And another thought: when you think something like this might be happening, use "view source" in your browser to see what the browser is actually rendering. If the page contains something you know you changed, chances are that it's a caching issue.
hth,
bear
 
Roy Ben Ami
Ranch Hand
Posts: 732
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
actually i have the same problem with Tomcat 4.0 and i don think it is the browser fault.
I need to shutdown tomcat and restart it again in order for the classes to refresh themselves.
i also have the DefaultContext thing in the server.xml
i wonder if anyone knows another thing perhaps in tomcat you need to set in order that it will recompile those class files without restarting it.
 
Ruilin Yang
Ranch Hand
Posts: 150
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Sometimes it ia also helpful to start a fresh browser to see your new changes.
 
Bob Young
Ranch Hand
Posts: 65
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Great advise, worked like a charm. Browser now set to update on every hit. I actually got two fixes for the price of one, this turned out to be the cause of another problem. Double thanks.
 
Mike Curwen
Ranch Hand
Posts: 3695
IntelliJ IDE Java Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Check out this thread in the Apache/Tomcat forum.

http://www.coderanch.com/t/81662/Tomcat/servlet-not-reloading-Tomcat

I played around with it for quite some time, because this is a very common complaint about Tomcat. And I could never reliably reproduce other people's problems with Tomcat not reloading, so I tried various combinations of settings. Read the above thread for the full scoop.
 
Roy Ben Ami
Ranch Hand
Posts: 732
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
thanks Mike!
works like a charm.
i have never seen the DefaultContext work , so i really think your way is the way to go.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!