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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T18:47:32+00:00 2026-06-05T18:47:32+00:00

My filter mapping in web.xml is as follows: <filter> <filter-name>LoginCheckFilter</filter-name> <filter-class>com.tutorial.filter.LoginCheckFilter</filter-class> </filter> <filter-mapping> <filter-name>LoginCheckFilter</filter-name>

  • 0

My filter mapping in web.xml is as follows:

  <filter>
    <filter-name>LoginCheckFilter</filter-name>
    <filter-class>com.tutorial.filter.LoginCheckFilter</filter-class>
  </filter>
  <filter-mapping>
    <filter-name>LoginCheckFilter</filter-name>
    <url-pattern>/admin*</url-pattern>
  </filter-mapping>

When I run my app and hit http://localhost:8080/admin my filter is not getting executed. I’m not able to understand why.

Is there any problem with the pattern. Also If I remove '*' from the pattern then the filter is getting executed on hitting above url.

Need help on this. Thanks.

  • 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-05T18:47:33+00:00Added an answer on June 5, 2026 at 6:47 pm

    The specifications (paragraph 12.2) says the following:

    In the Web application deployment descriptor, the following syntax is
    used to define mappings:

    • A string beginning with a ‘/’ character and
      ending with a ‘/*’ suffix is used for path mapping.

    • A string
      beginning with a ‘*.’ prefix is used as an extension mapping.

    • The
      empty string (“”) is a special URL pattern that exactly maps to the
      application’s context root, i.e., requests of the form
      http://host:port/<contextroot>/. In this case the path info is ’/’ and
      the servlet path and context path is empty string (““).

    • A string
      containing only the ’/’ character indicates the “default” servlet of
      the application. In this case the servlet path is the request URI
      minus the context path and the path info is null.

    • All other strings
      are used for exact matches only.

    So the * is taken literally, unless the pattern ends with /* or starts with *.

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

Sidebar

Related Questions

my web.xml config is <filter> <filter-name>springSecurityFilterChain</filter-name> <filter-class>org.springframework.web.filter.DelegatingFilterProxy</filter-class> </filter> <filter-mapping> <filter-name>springSecurityFilterChain</filter-name> <url-pattern>/*</url-pattern> </filter-mapping> here is
Suppose I have following in my web.xml <filter-mapping> <filter-name>F1</filter-name> <url-pattern>/XYZ/*</url-pattern> </filter-mapping> <filter-mapping> <filter-name>F2</filter-name> <url-pattern>/XYZ/abc.do</url-pattern>
Consider the following filter mappings in my web.xml <filter-mapping> <filter-name>rememberMeCookieFilter</filter-name> <url-pattern>/*</url-pattern> </filter-mapping> <filter-mapping> <filter-name>mustBeSignedInFilter</filter-name>
I have a Struts2 (2.1.8.1) web application. My web.xml looks like, <filter> <filter-name>struts2</filter-name> <filter-class>org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter</filter-class>
Here is my config in web.xml file <listener> <listener-class>org.apache.struts2.tiles.StrutsTilesListener</listener-class> </listener> <filter> <filter-name>struts2</filter-name> <filter-class>org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter</filter-class> </filter>
What is the use of web.xml and why do we use? <filter> <filter-name>wicket.mysticpaste</filter-name> <filter-class>org.apache.wicket.protocol.http.WicketFilter</filter-class>
Hello I wish I could define two filters like this <filter-mapping> <filter-name>SecurityFilter</filter-name> <url-pattern>/*</url-pattern> </filter-mapping>
A web.xml of ours contains following excerpt.. <servlet> <servlet-name>testServlet</servlet-name> <servlet-class> org.springframework.web.servlet.DispatcherServlet </servlet-class> <load-on-startup>1</load-on-startup> </servlet>
The default web.xml configuration for OpenAM provides a filter-mapping that includes all URI's within
I am new to spring security I have web.xml <?xml version=1.0 encoding=UTF-8?> <web-app xmlns=http://java.sun.com/xml/ns/javaee

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.