I have a standard Maven webapp structure defined, and it uses Spring MVC.
I am using an embedded Jetty server (java class) for testing the application in development.
The code used to create the Jetty server is outlined below. If I make changes to any JSP files, the changes are immediately visible in the browser.
However if I change any class files, e.g Controllers, the changes are not hot deployed?
What do I have to do get this to work?
I have searched this and I think I need to use the class org.eclipse.jetty.util.Scanner and specifically the setScanInterval method, but not sure how to wire this up?
Here is the code to create the Server
String webAppDir = "src/main/webapp/";
Server server = new Server(8080);
WebAppContext webApp = new WebAppContext();
webApp.setContextPath("/");
webApp.setDescriptor(webAppDir + "/WEB-INF/web.xml");
webApp.setResourceBase(webAppDir);
webApp.setParentLoaderPriority(true);
HandlerCollection hc = new HandlerCollection();
ContextHandlerCollection contextHandlerCollection = new ContextHandlerCollection();
hc.setHandlers(new Handler[] { contextHandlerCollection });
hc.addHandler(webApp);
server.setHandler(hc);
return server;
Thanks in advance