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

  • Home
  • SEARCH
  • 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 6962241
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T15:38:03+00:00 2026-05-27T15:38:03+00:00

I am attempting to use Spring 3′ MVC support for annotated controllers in my

  • 0

I am attempting to use Spring 3′ MVC support for annotated controllers in my web application.

In my application-context.xml, I’ve added the following:

<mvc:annotation-driven />
<context:component-scan base-package="com.abc.def.etc"/>
<bean id="jspViewResolver" class="org.springframework.web.servlet.view.InternalResourceViewResolver">
    <property name="viewClass" value="org.springframework.web.servlet.view.JstlView"/>
    <property name="prefix" value="/WEB-INF/jsp/"/>
    <property name="suffix" value=".jsp"/>
    <property name="order" value="1" />
</bean>

My Controller is annotated as follows:

@Controller
@RequestMapping("/optimizerRules")
public class OptimizerRulesController {
private OptimizerRulesService optimizerRulesService;
private static final Log LOG = LogFactory.getLog(OptimizerRulesController.class);

public OptimizerRulesController()
{
    LOG.info("Initializing OptimizerRulesController");
}

@RequestMapping(method = RequestMethod.GET)
public ModelAndView getRuleAttributesAndRules(ModelMap model)
{
    LOG.info("Entering getRuleAttributesAndRules method");
    }

When I start up my application I can see in my logs that the OptimizerRulesController has been initialized. I can also see the following:

Creating instance of bean 'optimizerRulesController'
Initializing OptimizerRulesController
Mapped URL path [/optimizerRules] onto handler 'optimizerRulesController'

However, when I invoke my application using http://localhost:8080/appName/optimizerRules I get a 404 error!
What configuration am I missing here?

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-27T15:38:03+00:00Added an answer on May 27, 2026 at 3:38 pm

    Spring MVC would normally log that no mapping is found for a particular request at WARN level. Assuming you’re not seeing that in your logs and assuming that WARN is enabled, and since you’re not seeing your own log statement, it sounds like your request isn’t even hitting the Spring MVC DispatcherServlet, which probably means the URL is wrong.

    The URL should be http://server:port/war/dispatcherServletMapping/optimizerRules, so your web.xml should tell you the missing path component, if my assumptions are valid.

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

Sidebar

Related Questions

I am attempting to use a pooled connection for my web application in Java.
I am attempting to use libcurl to post XML data to a sort-of web
I'm attempting to use jQuery to do a $.post() to an MVC controller action.
I am attempting to use JAXB to unmarshall an XML files whose schema is
I'm trying to use Spring to configure a web app deployed in JBoss. I've
I'm attempting to learn Spring MVC but have been spoiled by Grails. While I
I'm attempting to use jQuery's $.ajax() function to post form variables to an MVC
So I'm attempting to use a combination of MEF and Ninject in an application
In C#, I'm attempting to use the following capture pattern with a variable -
I am attempting to use spring.net 's IoC conatiner in a class library which

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.