No view resolvers found

How do you correctly set up your servlet.xml so that the view resolver is detected by Intellij?

in web.xml i have a DispatcherServlet configured named 'spring' that is configured with the config file spring-servlet.xml

in spring-servlet.xml there is the following

    <context:component-scan base-package="my package"/>
    <mvc:annotation-driven />

    <bean id="internalResourceViewResolver" >
        <property name="viewClass" value="org.springframework.web.servlet.view.JstlView"/>
        <property name="prefix" value="/WEB-INF/htm/"/>
        <property name="suffix" value=".jsp"/>
    </bean>


Intellij detects that my controller is configured by that component scan, but does not see the view resolver so all of my ' new ModelAndView("foo")' show the message 'No view resolvers found.  

Are there any special requirements to configuring the view resolver to cause it to be detected by Intellij?

2 comments
Comment actions Permalink

Please make sure that Spring facet has picked up auto-configured application context for this dispatcher servlet. If it didn't, remove Spring facet of corresponding module and close/reopen project to trigger autodetection.

0
Comment actions Permalink

Figured it out, the document declaration in my web.xml was invalid.  It did not cause any issues for Intellij or Tomcat, but caused the autodetection for spring-mvc not to be triggered.

0

Please sign in to leave a comment.