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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T01:01:48+00:00 2026-05-25T01:01:48+00:00

My project includes older un-annotated controllers together with newer annotation-based controllers. I am using

  • 0

My project includes older un-annotated controllers together with newer annotation-based controllers.

I am using the latest Spring jars (3.0.5) and in my dispatcher-servlet.xml there’s <mvc:annotation-driven />.

The problem is that <mvc:annotation-driven /> causes the request mapping (through the name property of the controller beans in the dispatcher-servlet.xml) to my un-annotated controllers not to work… each time I direct the request to an un-annotated controller I am getting an error message such as:

org.springframework.web.servlet.DispatcherServlet noHandlerFound  
WARNING: No mapping found for HTTP request with URI [/some_path/some_page.htm] in DispatcherServlet with name 'dispatcher'

How can I keep the un-annotated controllers as they are but tell spring to recognize their (old style) mapping?

I am looking for solutions with minimum change to the Java code of the controllers that I already have.

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-05-25T01:01:48+00:00Added an answer on May 25, 2026 at 1:01 am

    When you add <mvc:annotation-driven /> to your config, it replaces the default set of handler mappings and handler adapters, and those defaults were the ones that handled the old-style controllers.

    You have 2 options. First thing to try is to remove <mvc:annotation-driven />. You can still use annotated controllers without this. It does add extra features like Jackson JSON support, but if you don’t need those extra features, then you don’t need it. So try your app without <mvc:annotation-driven /> and see if it still works.

    Failing that, you can reinstate the mappings and adapters for your old controllers. You didn’t say how your controllers used to have their URLs mapped, but try adding these to your config:

    <bean class="org.springframework.web.servlet.handler.BeanNameUrlHandlerMapping"/>
    <bean class="org.springframework.web.servlet.handler.ControllerClassNameHandlerMapping"/>
    

    If you used SimpleUrlHandlerMapping, then that should be working already.

    You also need to add the HandlerAdapter back in:

    <bean class="org.springframework.web.servlet.mvc.SimpleControllerHandlerAdapter"/>
    

    Don’t just add these in blindly. Try them individually, and see what the minimal set is to get your old controllers working alongside the new ones.

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

Sidebar

Related Questions

I want to use an older code-fragment in my Qt-project, which is using WinSocks.
My project includes a jar file because it is listed as a transitive dependency.
I have a project that includes a copy of phpMyAdmin. I do development locally
I have a very old project that includes the source from another project directly,
I'm working on a project which includes some slightly more complex dynamic layout of
Hi I have a visual studio project which includes postbuildevents in the following form:
I'm working on an ASP.NET MVC 2 / .NET 3.5 project which includes SSRS
My client needs the non-compiled code. What's that? My project folder includes: Classes:of course,
I have C++ project (VS2005) which includes header file with version number in #define
I have a project that has the following line in the additional includes section:

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.