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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T10:02:30+00:00 2026-05-26T10:02:30+00:00

I encountered a J2EE project written by others. When I come to the web.xml

  • 0

I encountered a J2EE project written by others. When I come to the web.xml, there are two different servlets mapped on the same URL pattern. I wonder the purpose of this approach. How exactly does that work and what’s the puspose?

Here is the relevant part of the web.xml:

<servlet>
    <servlet-name>fileDownload</servlet-name>
    <servlet-class>com.htsoft.core.web.servlet.FileDownloadServlet</servlet-class>
</servlet>
<servlet-mapping>
    <servlet-name>fileDownload</servlet-name>
    <url-pattern>/file-download</url-pattern>
</servlet-mapping>

<servlet>
    <servlet-name>fileDownLoad</servlet-name>
    <servlet-class>com.kaiwii.oa.action.system.FileDownloadServlet</servlet-class>
</servlet>
<servlet-mapping>
    <servlet-name>fileDownLoad</servlet-name>
    <url-pattern>/file-downLoad</url-pattern>
</servlet-mapping>  
  • 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-26T10:02:31+00:00Added an answer on May 26, 2026 at 10:02 am

    Only one servlet will get called; there’s no mechanism I’m aware of for handling a single request with two servlets (nor am I sure what that would even mean).

    Servlet URL patterns may overlap, but having two with the exact same URL doesn’t make sense. I don’t recall if the servlet spec explicitly disallows it, however matching stops at the first matching. The matching method is defined in the spec.

    Servlet 2.4 spec PDF See p. 85+

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

Sidebar

Related Questions

I have a J2EE project running on JBoss, with a maximum heap size of
I encountered an error today while trying to retrieve an XML by sending a
I encountered the following problem with MongoID. I've created two models which related by
I encountered a problem in c++. I read some codes,but there was a very
I encountered a code where this() method in java takes three parameters two being
I encountered an exception when unmarshalling from XML: unexpected element (uri:"", local:"Group"). Expected elements
Encountered such problem: I ve created a new blank project of ASP.NET MVC site.
Encountered a frustrating problem in our application today which came down to an ArrayIndexOutOfBounds
We encountered a problem with using Subversion on Windows. A developer committed a file
I encountered the following ddl in a pl/sql script this morning: create index genuser.idx$$_0bdd0011

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.