找不到beanDefinitationDecorator的元素

时间:2014-03-27 03:22:10

标签: spring hibernate spring-mvc hibernate-mapping spring-tool-suite

我的Servlet-context.xml在属性名称= mapping im获得在此行找到的多个注释

    <beans:bean id="urlMapping" class="org.springframework.web.servlet.handler.SimpleUrlHandlerMapping">

        <property name="mappings">
            <props>
                <props key="page.pdf">pdfController</props>
            </props>            
        </property>

</beans:bean>



<!-- Resolves views selected for rendering by @Controllers to .jsp resources in the /WEB-INF/views directory -->
<beans:bean class="org.springframework.web.servlet.view.InternalResourceViewResolver">
    <beans:property name="prefix" value="/WEB-INF/views/" />
    <beans:property name="suffix" value=".jsp" />


</beans:bean>

<context:component-scan base-package="com.me.controller" />     

1 个答案:

答案 0 :(得分:0)

需要使用prop元素标识单个属性,而不是props。尝试

<bean id="urlMapping" class="org.springframework.web.servlet.handler.SimpleUrlHandlerMapping">
  <property name="mappings">
    <props>
      <prop key="page.pdf">pdfController</prop>
    </props>
  </property>
</bean>