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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 19, 20262026-05-19T13:09:09+00:00 2026-05-19T13:09:09+00:00

I have this one mapping <servlet-mapping> <servlet-name>service</servlet-name> <url-pattern>/service/*</url-pattern> </servlet-mapping> but i also want /service/master

  • 0

I have this one mapping

<servlet-mapping>
<servlet-name>service</servlet-name>
<url-pattern>/service/*</url-pattern>
</servlet-mapping>

but i also want
/service/master
to map to master servlet.

<servlet-mapping>
<servlet-name>master</servlet-name>
<url-pattern>/service/master</url-pattern>
</servlet-mapping>

I believe there is a conflict here since calling /service/* will trigger service servlet right away. Is there a way for me to use some kind of exclusion in servlet-mapping or may be regexp to do what I want to do?

  • 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-19T13:09:10+00:00Added an answer on May 19, 2026 at 1:09 pm

    Servlet mappings always use the most specific match, so the path <context>/service/master will always map to master.

    This is the 1st rule of mappings from the Servlet 3.0 spec:

    1. The container will try to find an exact match of the path of the request
      to the path of the servlet. A
      successful match selects the servlet.
    2. The container will recursively try to match the longest path-prefix. This
      is done by stepping down the path tree
      a directory at a time, using the ’/’
      character as a path separator. The
      longest match determines the servlet
      selected.
    3. If the last segment in the URL path contains an extension (e.g.
      .jsp), the servlet container will try
      to match a servlet that handles
      requests for the extension. An
      extension is defined as the part of
      the last segment after the last ’.’
      character.
    4. If neither of the previous three rules result in a servlet match, the
      container will attempt to serve
      content appropriate for the resource
      requested. If a “default” servlet is
      defined for the application, it will
      be used. Many containers provide an
      implicit default servlet for serving
      content.
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have the following URL pattern: <servlet-mapping> <servlet-name>name_of_a_servlet</servlet-name> <url-pattern>*.some_pattern</url-pattern> </servlet-mapping> If i have more
I have a spring app with one servlet that has url-mapping of *.html. Everything
I have the following servlet definitions: <servlet> <servlet-name>licenseGenService</servlet-name> <servlet-class>org.springframework.web.context.support.HttpRequestHandlerServlet</servlet-class> </servlet> <servlet-mapping> <servlet-name>licenseGenService</servlet-name> <url-pattern>/remoting/licensing</url-pattern> </servlet-mapping>
I have this WinForms project (based on this one , but modified for SharePoint
I have this fiddle : http://jsfiddle.net/XjeCf/1/ that works like I want and this one
I have this in one of my haml views: -form_for :news_item_comment, :url=>{:id => comment.id,
I would have thought this one would be simple but I'm trying to change
I hardly even know how to ask this one, but here goes. I have
I have two list boxes with one to one mapping. They are also scrollable.
I have this one class: say InterClass . This class is declared in say,

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.