我的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" />
答案 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>