Tutorial :Eclipse Servlets take a long time to update



Question:

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?


Solution:1

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.


Note:If u also have question or solution just comment us below or mail us on toontricks1994@gmail.com
Previous
Next Post »