Note that there are some explanatory texts on larger screens.

plurals
  1. POSpring 3 @Controller is not being invoked for Get request
    primarykey
    data
    text
    <p>I am attempting to use Spring 3' MVC support for annotated controllers in my web application.</p> <p>In my application-context.xml, I've added the following:</p> <pre><code>&lt;mvc:annotation-driven /&gt; &lt;context:component-scan base-package="com.abc.def.etc"/&gt; &lt;bean id="jspViewResolver" class="org.springframework.web.servlet.view.InternalResourceViewResolver"&gt; &lt;property name="viewClass" value="org.springframework.web.servlet.view.JstlView"/&gt; &lt;property name="prefix" value="/WEB-INF/jsp/"/&gt; &lt;property name="suffix" value=".jsp"/&gt; &lt;property name="order" value="1" /&gt; &lt;/bean&gt; </code></pre> <p>My Controller is annotated as follows:</p> <pre><code>@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"); } </code></pre> <p>When I start up my application I can see in my logs that the OptimizerRulesController has been initialized. I can also see the following:</p> <pre><code>Creating instance of bean 'optimizerRulesController' Initializing OptimizerRulesController Mapped URL path [/optimizerRules] onto handler 'optimizerRulesController' </code></pre> <p>However, when I invoke my application using <a href="http://localhost:8080/appName/optimizerRules" rel="nofollow">http://localhost:8080/appName/optimizerRules</a> I get a 404 error! What configuration am I missing here?</p> <p>Thanks</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload