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

  • Home
  • SEARCH
  • 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 4082408
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T18:11:02+00:00 2026-05-20T18:11:02+00:00

In development I use jetty as the servlet container. I have the following development

  • 0

In development I use jetty as the servlet container. I have the following development configuration:

  • master project which has wabapp directory
  • derived project which overrides some of the files in webapp directory

The master project webapp can be started in development mode thanks to providing appropriate WebAppContext to jetty.

Now I want to start derived project analogously, assuming that when request is made, there is an attempt to:

  • get resource from webapp directory of derived project
  • if it does not exists, get it from webapp directory of master project

I know that it is possible to override WebAppContext#getResource() method, however some libraries we use in the project seem to perform IO operations on wabapp directory on their own. For example by calling ServletContext#getRealPath("/"), and then reading files without use of ServletContext#getResource() method. The problem could be solved on lower level by some virtual file system on top of File, however it does not seem to be supported in JDK 1.6, any suggestions?

  • 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-05-20T18:11:03+00:00Added an answer on May 20, 2026 at 6:11 pm

    It seems that using something like ResourceCollection is sufficient:

    http://download.eclipse.org/jetty/stable-7/apidocs/org/eclipse/jetty/util/resource/ResourceCollection.html

    Unfortunately the GWT’s DevMode which I use is based on jetty 6, where ResourceCollection is unavailable. I extended the Resource class myself, and together with own GWT JettyLauncher, and thanks to small trick with setting resourceBase on DefaultServlet via reflection, I was able to serve webapp from two directories simultaneously.

    protected void doStart() throws Exception {
        setClassLoader(new LauncherWebAppClassLoader());
        super.doStart();
        ServletHolder holder = getServletHandler().getServlet("default");
        Servlet servlet = holder.getServlet();
        Field field = servlet.getClass().getDeclaredField("_resourceBase");
        field.setAccessible(true);
        field.set(servlet, combinedResourceBase);
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I want to build a lightweight linux configuration to use for development. The first
I currently use Notepad++ for most of my development. I have been checking out
I usually use IIS in conjunction with the OutSystems development platform, which does code-generation
I have to use XP as my development machine so far. But VS 2008's
I've had Jetty recommended as a good container for fast and simple development, in
I've been using the following web development stack for a few years: java/spring/hibernate/mysql/jetty/wicket/jquery For
I use eclipse and the maven plugin. I have a big multi-module project (~6
One meme that gets stressed with Java development is always use ArrayList over Vector.
I use the ASP.NET Development Web server (also known as the Visual Studio Development
Apparently we use the Scrum development methodology. Here's generally how it goes: Developers thrash

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.