Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8656969
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T15:24:29+00:00 2026-06-12T15:24:29+00:00

I have a standard Maven webapp structure defined, and it uses Spring MVC. I

  • 0

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

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-12T15:24:30+00:00Added an answer on June 12, 2026 at 3:24 pm

    For hot deployment you need to use the WebAppProvider and the DeploymentManager. Those you can configure to manage the scanning for changes and the reloading of the webapp. So it is clear, the WebappContext is not what manages the deployment of a webapp, it is merely the container class that is gets deployed so there is another mechanism that works outside of that which can handle the concepts of deploy/redeploy.

    http://git.eclipse.org/c/jetty/org.eclipse.jetty.project.git/tree/jetty-deploy/src/test/resources/jetty-deploy-wars.xml

    You can take that chunk of xml there and convert into the java calls you need to do this embedded.

    Or use something like the jrebel jvm plugin which provides for automatic class reloading.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have followed the instructions to create a Standard WebApp with Jetty and Maven
I'm working with a project that is setup using the standard Maven directory structure
I have a Java web-app using standard web.xml and servlets. At the moment, I'm
We're using Gherkin, Cucumber-jvm and Webdriver to run acceptance tests against a standard Java/Spring
I have a Java project and used the standard maven archetype to create the
I have a desktop Java application built using Maven 2 (but I could upgrade
Assuming I have a .properties file and hibernate.cfg.xml in a standard maven web application
I have to replace a Java source file during maven compile if a special
I have worked on maven projects in which the directory structure looks like: src/
I try do the following: I have a standard POM defined for all my

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.