<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:p="http://www.springframework.org/schema/p"
xmlns:aop="http://www.springframework.org/schema/aop"
xmlns:context="http://www.springframework.org/schema/context"
xmlns:mvc="http://www.springframework.org/schema/mvc"
xsi:schemaLocation="http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
http://www.springframework.org/schema/context
http://www.springframework.org/schema/context/spring-context-3.0.xsd
http://www.springframework.org/schema/mvc
http://www.springframework.org/schema/mvc/spring-mvc-3.0.xsd
http://www.springframework.org/schema/aop
http://www.springframework.org/schema/aop/spring-aop.xsd">
<context:component-scan base-package="com.gttown.jui.controller" />
<bean
class="org.springframework.web.servlet.mvc.annotation.AnnotationMethodHandlerAdapter">
<property name="messageConverters">
<list>
<bean
class="org.springframework.http.converter.StringHttpMessageConverter">
<property name="supportedMediaTypes">
<list>
<value>text/plain;charset=UTF-8</value>
</list>
</property>
</bean>
</list>
</property>
</bean>
<bean
class="org.springframework.web.servlet.view.InternalResourceViewResolver"
p:viewClass="org.springframework.web.servlet.view.JstlView" p:prefix="/WEB-INF/jsp/"
p:suffix=".jsp">
</bean>
<!-- <bean id="freemarkerConfigurer" class="org.springframework.web.servlet.view.freemarker.FreeMarkerConfigurer">
<property name="templateLoaderPath"> <value>/WEB-INF/freemarker/</value>
</property> <property name="freemarkerSettings"> <props> <prop key="template_update_delay">1</prop>
<prop key="defaultEncoding">UTF-8</prop> <prop key="classic_compatible">true</prop>
<prop key="date_format">yyyy-MM-dd</prop> <prop key="time_format">HHSs</prop>
<prop key="number_format">#</prop> </props> </property> </bean> <bean id="viewResolver"
class="org.springframework.web.servlet.view.freemarker.FreeMarkerViewResolver">
<property name="cache" value="true"/> <property name="viewClass" value="org.springframework.web.servlet.view.freemarker.FreeMarkerView"/>
<property name="suffix" value=".ftl"/> <property name="exposeRequestAttributes"
value="true"/> <property name="exposeSessionAttributes" value="true"/> <property
name="exposeSpringMacroHelpers" value="true"/> <property name="allowSessionOverride"
value="true"/> <property name="contentType" value="text/html;charset=gbk"/>
<property name="requestContextAttribute" value="rc"/> </bean> -->
<mvc:resources mapping="/styles/**" location="/styles/" cache-period="31536000"/>
</beans>
访问:
http://localhost:8080/management/user/select.dadao
报错:
PageNotFound - No mapping found for HTTP request with URI [/management/user/select.dadao] in DispatcherServlet with name 'dispatcherServlet'
加上<mvc:annotation-driven/>
话说你用插入代码的方式贴出来,这看着多累啊
回复 @Kings__:其实这句话就是替你注册了几个必备和常用的bean,不加的话就需要自己手动一个个配置注册一下。我看你这里没有注册DefaultAnnotationHandlerMapping,所以会映射不到。当然还是用这一行比较简单是的,我后我加上这句就好了,不是web.xml的请求过滤的问题web.xml如何配置?没见过.dadao的结束符版权声明:本文内容由阿里云实名注册用户自发贡献,版权归原作者所有,阿里云开发者社区不拥有其著作权,亦不承担相应法律责任。具体规则请查看《阿里云开发者社区用户服务协议》和《阿里云开发者社区知识产权保护指引》。如果您发现本社区中有涉嫌抄袭的内容,填写侵权投诉表单进行举报,一经查实,本社区将立刻删除涉嫌侵权内容。