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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T14:36:13+00:00 2026-06-11T14:36:13+00:00

What is the difference between Spring BeanNameUrlHandlerMapping and SimpleUrlHandlerMapping? After going through some site

  • 0

What is the difference between Spring BeanNameUrlHandlerMapping and SimpleUrlHandlerMapping?

After going through some site I understand that
BeanNameUrlHandlerMapping is the default HandlerMapping for DispatcherServlet.

Also in BeanNameUrlHandlerMapping you can directly map url with Controller.

but same thing can be done with SimpleUrlHandlerMapping as well.

I know something but not that much clear, that it has to do something with

name accepts / but id can’t…..but i am confused.

what is the exact diffrence? what is the need of SimpleUrlHandlerMapping?

please explain…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-11T14:36:14+00:00Added an answer on June 11, 2026 at 2:36 pm

    We have to register more than one urls if we want map more than one url to be mapped to a single controller class and this is not a good way to work with Spring IoC.

    SimpleUrlHandlerMapping is a simple way to define url mapping using a map or property bean. This simplify the url mapping in Spring MVC.

    Example BeanNameUrlHandlerMapping

    <bean name="/hello.htm" class="com.raistudies.ui.comtroller.HelloController"/>
    
    <bean name="/sayHello*" class="com.raistudies.ui.comtroller.HelloController"/>
    
    <bean id="urlHandler" class="org.springframework.web.servlet.handler.BeanNameUrlHandlerMapping"/>
    

    Important:

    • Is necessary to define a bean for each url
    • Spring container has a bean by url. Although all url are served by the same bean

    Example SimpleUrlHandlerMapping

    <bean id="helloController" class="com.raistudies.ui.controller.HelloController"/>
    
      <bean id="urlHandler" class="org.springframework.web.servlet.handler.SimpleUrlHandlerMapping">
            <property name="urlMap">
                <map>
                    <entry key="/hello.htm" value-ref="helloController"/>
                    <entry key="/sayHello*" value-ref="helloController"/>
                    <entry key="/welcome.html" value-ref="helloController"/>
                    <entry key="/welcomeUser*" value-ref="helloController"/>
                </map>
            </property>
        </bean>
    

    Important:

    • Using a single bean for URLs that use the same controller.
    • Is not necessary to define a bean for each url
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

i AM NEW TO Spring Framework . Can any body explain me difference between
It's not clear for me what is the difference in spring security between :
What is the major difference between the Spring MVC and Struts MVC?
What is the difference between getAllFailureExceptions() and getFailureExceptions() methods of Spring Batch JobExecution class?
I am striving to know the difference between Java EE and Spring Framework. Could
What is difference between these 2 Spring Annotation and XML config 1) Annotation Based
I am looking to find out the difference between the spring:bind and form:form tag
In a spring configuration, what is the difference between using name vs id? I'm
As the title says what is the difference between dispatcher-servlet.xml and spring-servlet.xml They seem
The download page on http://www.springsource.com/download/community mentions: spring-framework-2.5.6.SEC01 spring-framework-2.5.6 What is the difference between those

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.