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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T20:36:59+00:00 2026-05-22T20:36:59+00:00

I map all requests to /* to a specific servlet. My static content is

  • 0

I map all requests to /* to a specific servlet.
My static content is hidden by this configuration.

How can i allow access to specific files (such as crossdomain.xml)?

  • 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-22T20:37:00+00:00Added an answer on May 22, 2026 at 8:37 pm

    When you map /* to a specific servlet, all requests will be forwarded to that servlet, unless you provide a more explicit mapping to another servlet.

    That is, if you have /* mapped to ServletA, and /static/* mapped to ServletB, then following Servlets will get called.

    http://localhost:8080/abc.jpg            -> ServletA
    http://localhost:8080/static/abc.jpg     -> ServletB
    http://localhost:8080/xyz/abc.jpg        -> ServletA
    

    So one option you have is to write a Servlet to handle the static content, which will grab the file and return it as response. You can map that servlet to a prefixed by something like /static/*. This requires that all URL references to your static files to be updated to contain this ‘/static’ part.

    If that is not feasible for you, then probably you can use the same servlet, but mapped to multiple URL patterns (probably by extension) as follows.

    <servlet>
        <servlet-name>static-servlet</servlet-name>
        <servlet-class>xxx.yyy.StaticServlet</servlet-class>
    </servlet>
    
    <servlet-mapping>
        <servlet-name>static-servlet</servlet-name>
        <url-pattern>*.xml</url-pattern>
    </servlet-mapping>
    
    <servlet-mapping>
        <servlet-name>static-servlet</servlet-name>
        <url-pattern>*.jpg</url-pattern>
    </servlet-mapping>
    

    If you want this to be fine-grained to the level of each file, you can map the servlet to your file URL as well.

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

Sidebar

Related Questions

I have been googling a lot about this, but I can't find a specific
I am using <url-pattern>/*</url-pattern> to map all the requests to one sevlet,where i do
Is it possible to redirect all requests to x.domain.com/.* to y.domain.com/.* WITHOUT letting this
If I map my spring application to process all incoming requests ('/*'), then requests
Does FileChannel#map allocate all the memory needed for the resulting ByteBuffer immediately, or is
All - I'm trying to understand the first section of the Map file produced
How to set all the values in a std::map to the same value, without
All, I was wondering if anyone knew a better patten than: array_of_hashes.map { |hash_from_array|
A fellow developer changed all the values in the userid column of table map
I implemented a sparse matrix as List<Map<Integer,Double>> . To get all entries of row

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.