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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T23:41:00+00:00 2026-05-13T23:41:00+00:00

actually I thought I was trying something really simple. ControllerClassNameHandlerMapping sounded great to produce

  • 0

actually I thought I was trying something really simple. ControllerClassNameHandlerMapping sounded great to produce a small spring webapp using a very lean configuration. Just annotate the Controller with @Controller, have it extend AbstractController and the configuration shouldn’t need more than this

<context:component-scan base-package="test.mypackage.controller" />
<bean id="urlMapping" class="org.springframework.web.servlet.mvc.support.ControllerClassNameHandlerMapping" />

to resolve my requests and map them to my controllers. I’ve mapped the servlet to “*.spring”, and calling

<approot>/hello.spring

All I ever get is an error stating that no mapping was found. If however I extend the MultiActionController, and do something like

<approot>/hello/hello.spring

it works. Which somehow irritates me, as I would have thought that if that is working, why didn’t my first try? Does anyone have any idea? The two controllers I used looked like this

@Controller
public class HelloController extends AbstractController {
@Override
protected ModelAndView handleRequestInternal(HttpServletRequest request, HttpServletResponse response) throws Exception {
    ModelAndView modelAndView = new ModelAndView("hello");
    modelAndView.addObject("message", "Hello World!");
    return modelAndView;
    }
}

and

@Controller
public class HelloController extends MultiActionController {
public ModelAndView hello(HttpServletRequest request, HttpServletResponse response) throws Exception {
    ModelAndView modelAndView = new ModelAndView("hello");
    modelAndView.addObject("message", "Hello World!");
    return modelAndView;
    }
}
  • 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-13T23:41:00+00:00Added an answer on May 13, 2026 at 11:41 pm

    You shouldn’t be using @Controller at the same time as extending from AbstractController. Do one or the other.

    Also, @Controller should be used along with the @RequestMapping annotation.

    If you want lean config, then just put this in your config file:

    <context:component-scan base-package="test.mypackage.controller" />
    

    And use this class:

    @Controller
    public class HelloController {
    
       @RequestMapping("/hello")
       public String handle(ModelMap model) {
          model.addAttribute("message", "Hello World!");
          return "hello";
       }
    }
    

    In fact, you can probably leave out the return value altogether, Spring should infer the view name “hello” from the request path, but I left this in for clarity.

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

Sidebar

Ask A Question

Stats

  • Questions 497k
  • Answers 497k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer Hmmm, actually the cookie IS being deleted. I appear to… May 16, 2026 at 11:55 am
  • Editorial Team
    Editorial Team added an answer You can never tell if a file is currently being… May 16, 2026 at 11:55 am
  • Editorial Team
    Editorial Team added an answer Searching through the Clips Reference manual, I finally found the… May 16, 2026 at 11:55 am

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

Related Questions

I'm trying to do something like this... <Style x:Key="MyBorderStyle" TargetType="Border"> <Setter Property="Padding" Value="{TemplateBinding Padding}"
I noticed something when I was trying to solve a problem today. The scalar
I'm trying to write a simple measurement plug-in for Audacity and it's about as
I don't really know much about the internals of compiler and JIT optimizations, but
I've been toying with the idea of building a web-based Roguelike game using Silverlight
I'm trying to wrap my head around Object Oriented programming. But I'm having some
Greetings, I am currently trying to learn some Java programming. To do this I'm
I'm trying to debug an application on an embedded device running an old version
Possible Duplicate: How can I declare a thousand separator in read.csv? I actually have
I'm trying to find a way to implement file manager functionality in an mvc

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.