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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T18:12:21+00:00 2026-06-08T18:12:21+00:00

How does Spring Dispatcher Servlet create Default beans without any predefined XML configuration file.

  • 0

How does Spring Dispatcher Servlet create Default beans without any predefined XML configuration file. (I am not talking of annotations).

If we don’t give any default:

1) Handler mapping object
2) Multipart Resolver
3) Theme Resolver etc…
in the XML configuration file, Spring automatically creates these beans.

How does Spring create these beans when there is no explicit declaration of these beans anywhere?
And once created are these default beans available in the Application Context? I mean can we get these beans with a call to getBean() method on the context object?

  • 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-08T18:12:23+00:00Added an answer on June 8, 2026 at 6:12 pm

    Check out DispatcherServlet.initStrategies():

    protected void initStrategies(ApplicationContext context) {
        initMultipartResolver(context);
        initLocaleResolver(context);
        initThemeResolver(context);
        initHandlerMappings(context);
        initHandlerAdapters(context);
        initHandlerExceptionResolvers(context);
        initRequestToViewNameTranslator(context);
        initViewResolvers(context);
    }
    

    You’ll note that DispatcherServlet tries to find existing beans with some fixed name and either uses default or nothing if non found.

    1) Handler mapping object

    No resolver is used if no other resolver is configured.

    2) Multipart Resolver

    Check out AnnotationDrivenBeanDefinitionParser.parse() – quite complex, be warned.

    3) Theme Resolver

    FixedThemeResolver is used if no other resolver is configured.

    The internals of Spring MVC context startup are too complex for a reason – you should not mess around with them. Just supply callbacks or beans you want to replace.

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

Sidebar

Related Questions

I added Comet servlet into Spring web application. This servlet does not differ from
I read about the Dispatcher Servlet on the Spring Source website. http://static.springsource.org/spring/docs/current/spring-framework-reference/html/mvc.html My question
When my spring is loading up, it says applicationContext.xml is not found in the
jsp file which contains username & password which is processed at LoginServlet...this servlet does
What is the correct way to split Spring's configuration to multiple xml files? At
From XmlWebApplicationContext javadoc: By default, the configuration will be taken from /WEB-INF/applicationContext.xml for the
Does the Spring Security plugin for Grails support automatically locking an account after X
Does anybody has an experience with Spring Integration project as embedded ESB? I'm highly
Does it need manually close InputStream (bean.getContentAsStream()) in java after pass to Spring JDBC
I am getting the error: 'string[]' does not contain a definition for 'Cast' and

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.