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 8872663
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T18:16:29+00:00 2026-06-14T18:16:29+00:00

Tomcat 7 provide new aliases that allow to store static content outside the WAR

  • 0

Tomcat 7 provide new aliases that allow to store static content outside the WAR File.
I found some instructions how to do that in http://www.developer.com/java/web/article.php/3904871/Top-7-Features-in-Tomcat-7-The-New-and-the-Improved.htm part 4.

But it does not work for me.

I have two context XML files. One for my application (admin.xml) and one for my static resources (uploads.xml).

I did everything like mentioned in this tutorial but Tomcat does not see any static resources outside WAR file.

My static resources structure:

/home/user/admin-images/-
                   -234bF5_image/image.jpg
                   -572d44_otherImage/otherImage.jpg
                   -12A4uR_otherImage/otherImage.jpg

admin.xml:

<Context path="/admin" 
        docBase="path/to/application/target" reloadable="false">
    <WatchedResource>WEB-INF/web.xml</WatchedResource>
    <Manager pathname="admin" />
</Context>

uploads.xml:

<?xml version="1.0" encoding="UTF-8"?>
<Context path="/admin" aliases="/images=/home/user/admin-images">

</Context>

After context deploy images not reachable:

http://localhost:8080/admin/images/234bF5_image/image.jpg

when I try to reach this I get error that image can not be displayed.

  • 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-14T18:16:30+00:00Added an answer on June 14, 2026 at 6:16 pm

    I did not manage to get it working. But I found another solution to serve static images outside web application.

    You need define context in server.xml inside Tomcat configuration:

    server.xml (this have to go into ‘Host’ tag):

    ...
    ...
    <Host>
        ...
        ...
        <Context docBase="/home/user/admin-images/" path="/images" />
        ...
        ...
    </Host>
    ...
    ...
    

    That way I am able to reach static images like that:
    [http://localhost:8080/admin/images/234bF5_image/image.jpg]

    My new question would be:
    This way to share static resources is safe? Does it have any disadvantages?

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

Sidebar

Related Questions

I'm building a webapp that will need to provide some real-time tracking information overlayed
Java EE application servers provide all the features of tomcat, so why use tomcat
Tomcat has got that well-known memory leak problem that causes PermGen space errors after
Tomcat does not encode correctly String literals that contain unicode characters. The problem occurs
Does Tomcat sandbox apps, like running them on a separate JVM or of some
I want to test some new functionality which is part of an internal web
I'm trying to send plain text error messages from a tomcat servlet, so that
I am using Atmosphere runtime 0.6 Snapshot. Tomcat 7 is logging correctly that I
So I just found out today that Log4J 2.0 is now actively being developed,
Could someone please provide explanation how Java multi-threaded program (e.g. Tomcat servlet container) is

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.