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

  • Home
  • SEARCH
  • 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 6784179
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T16:57:31+00:00 2026-05-26T16:57:31+00:00

I have this segment of XML: <mvc:interceptors> <mvc:interceptor> <mvc:mapping path=/statics/** /> <bean class=com.company.website.servlet.StaticsHandlerInterceptor />

  • 0

I have this segment of XML:

<mvc:interceptors>
    <mvc:interceptor>
        <mvc:mapping path="/statics/**" />
        <bean class="com.company.website.servlet.StaticsHandlerInterceptor" />
    </mvc:interceptor>
    <mvc:interceptor>
        <mvc:mapping path="/data/**" />
        <bean class="com.company.website.servlet.AJAXHandlerInterceptor" />
    </mvc:interceptor>
    <mvc:interceptor>
        <mvc:mapping path="/**" />
        <bean class="com.company.website.servlet.PageHandlerInterceptor" />
    </mvc:interceptor>
</mvc:interceptors>

I have three different interceptors for a reason, though the StaticsHandlerInterceptor is just the preHandle method returning true (for all of my static content (js, css, etc)). The second one is for AJAX requests. The third one is for actual pages. What I see happening is the statics and the AJAX interceptors being called when they are supposed to be; however, with them, the page interceptor is always being called. I only want the page interceptor to be called for pages. How do I make that happen?

  • 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-26T16:57:31+00:00Added an answer on May 26, 2026 at 4:57 pm

    Assuming you use a consistent naming scheme for your pages, use that – e.g. if your externally-visible page URLs end with .html, specify:

    <mvc:mapping path="/**/*.html" />
    

    It’s not very RESTful to have “extensions” like that though – you might prefer to use a scheme like:

    • GET of /user/{id} = returns User object for user {id}, JSON format
    • POST to /user/{id} = updates User object from JSON object
    • GET to /user/page/{id} = returns HTML page for user {id}
    • etc etc

    Then you can use a nice readable, semantic mapping like:

    <mvc:mapping path="/**/page/**" />
    

    which will work to any “depth” of URL structure.

    Edit: OK so it seems that using the mvc:interceptors style of bean declaration isn’t going to give you the expressiveness you need to specify exclusion by pattern rather than inclusion.

    From what I can make out in this blog, using the more-verbose HandlerMapping approach will allow you to invert the match logic – you can specify what not to match on to get what you need:

    <bean id="nonStaticNonDataMapper" class="org.springplugins.web.IgnoreSelectedAnnotationHandlerMapping">
    <property name="order">
        <value>0</value>
    </property>
    <property name="urls">
        <list>
            <value>/statics/**</value>
            <value>/data/**</value>
        </list>
    </property>
    <property name="interceptors">
        <list>
            <bean class="com.company.website.servlet.PageHandlerInterceptor" />
        </list>
    </property>
    

    (Apologies for the formatting of the above snippet, Markdown thinks the /** is a comment 🙂

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

Sidebar

Related Questions

I have this XML i want display all fields on the uiview which comes
I have the following xml snippet <ZMARA01 SEGMENT=1> <CHARACTERISTICS_01>X,001,COLOR_ATTRIBUTE_FR,BRUN ÉCORCE,TMBR,French C</CHARACTERISTICS_01> <CHARACTERISTICS_02>X,001,COLOR_ATTRIBUTE,Timber Brown,TMBR,Color Attr</CHARACTERISTICS_02>
I have this segment of code , a lot of things skipped for brevity
Currently I have this url to view an image from the db (codeigniter) domain.com/view/id
I have this form declaration: <form method=post action=/web_services/buscar_vuelos?method=get> <div id=addSegment_wrapper> <button class=ui-button ui-widget ui-state-default
I have a java servelet segment, which can generate a XML file and print
I have a Java string which looks like this, it is actually an XML
I have this segment of Scala code which defines an ordering and applies it
If I have the following XML segment: <Times> <Time>1/1/1900 12:00 AM</Time> <Time>1/1/1900 6:00 AM</Time>
I have this code segment in which I am opening/closing a file a number

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.