views:

114

answers:

1

I'm testing running a simple Servlet from within Eclipse. When I click 'Run', the console says it is starting TomCat, and then an internal browser launches within Eclipse which shows my code.

However, if I make any changes in the servlet and click 'Refresh' in the browser, the changes don't show. Then, a few seconds later if i hit refresh, the changes begin to show randomly. So I'm guessing there's a cache setting somewhere that controls this.

How can I turn that cache setting off or otherwise make the Eclipse internal browser update instantly as soon as I hit refresh?

+2  A: 

This is caused by the way servlet developing works. When modifying your servlert, it needs to be submitted to the servlet container after compiling it. The servlet container itself needs to reload the servlet, the servlet must be instantiated (servlet lifecycle). Thats a lot of things to do, which may cause you waiing for an update visible in the browser some seconds.

Mork0075
I just hit the 'Switch location' button oin the properties of the server and now I'm getting a 404 error each time I try to run the project.. any ideas why? Switching it back doesn't fix it either
Click Upvote
If've read somewhere, that this crashes eclipse (https://jira.jboss.org/jira/browse/JBIDE-1301;jsessionid=503B21F0C781601EE988D0D89F1A745A?page=com.atlassian.jira.plugin.system.issuetabpanels%3Aall-tabpanel). Try to clean the deployment and restart Eclipse as well as you Application server.
Mork0075