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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T20:01:42+00:00 2026-05-27T20:01:42+00:00

When I use spring mvc, I use <mvc:resources /> to map the location of

  • 0

When I use spring mvc, I use <mvc:resources /> to map the location of the static resources to handler, and now I want to add some new functions to handler resource, is there anyone who can tell me how to override the ResourceHttpRequestHandler?

(Based on the following doc, the <mvc:resources /> use ResourceHttpRequestHandler to handle resources.)

Thanks in advance!

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

    I haven’t tried this but you could try extending the ResourceHttpRequestHandler and use a BeanFactoryPostProcessor to replace ResourceHttpRequestHandler class with your custom class . A similar solution is given here

    Sample…

    public class ResourceHttpRequestHandlerReplacer implements   BeanFactoryPostProcessor {
    public void postProcessBeanFactory(ConfigurableListableBeanFactory factory)
            throws BeansException {
    
        String[] names = factory.getBeanNamesForType(ResourceHttpRequestHandler.class);
    
        for (String name: names) {
            BeanDefinition bd = factory.getBeanDefinition(name);
            bd.setBeanClassName("org.myProject.CustomResourceHttpRequestHandler");
        }            
      }       
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

As recommended by http://static.springsource.org/spring/docs/3.0.x/spring-framework-reference/html/mvc.html#mvc-static-resources I wish to use <mvc:resources> for serving my spring static
I'm migrating a Spring MVC controller to use the newer style annotations, and want
I´m new in spring-mvc. So, i´m trying to use RESTFull urls ( i think
I want to create a new application in Spring MVC, before start it, I
I'm making a Spring MVC web-app with some RESTfull resources as an API. I
I use Spring MVC [version: 2.5] and Security[version: 2.0.4]. My problem looks like that:
I use Spring MVC (via Spring Roo) to build a small web application for
I use Spring MVC 3.0 and JSP. I have an object: public class ObjectWrapper
I wish to use Spring MVC to provide a REST web service. However, running
earlier I use Spring MVC and annotation @ModelAttribute. @Controller public class ArticleController { @ModelAttribute(articles)

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.