<context:component-scan base-package="com.huawei.tbsc.controller" use-default-filters="false">
<context:include-filter type="annotation" expression="org.springframework.stereotype.Controller" />
</context:component-scan>
<bean class="org.springframework.web.servlet.mvc.annotation.DefaultAnnotationHandlerMapping" />
<!-- 启动Spring MVC的注解功能,完成请求和注解POJO的映射 -->
<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>
<value>application/json;charset=UTF-8</value>
<value>application/x-www-form-urlencoded;charset=UTF-8</value>
</list>
</property>
</bean>
<bean
class="org.springframework.http.converter.json.MappingJacksonHttpMessageConverter">
<property name="supportedMediaTypes">
<list>
<value>application/json;charset=UTF-8</value>
</list>
</property>
</bean>
</list>
</property>
</bean>
web:
<servlet>
<servlet-name>springmvc</servlet-name>
<servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
<init-param>
<param-name>contextConfigLocation</param-name>
<param-value>classpath:spring-servlet.xml</param-value>
</init-param>
<load-on-startup>1</load-on-startup>
</servlet>
<servlet-mapping>
<servlet-name>springmvc</servlet-name>
<url-pattern>*.do</url-pattern>
</servlet-mapping>
分享到:
相关推荐
spring MVC配置详解
spring mvc配置演示源码 适合新手学习
Spring MVC 配置 urlrewrite 实例
Spring MVC 配置请求的默认处理器.rar
DispatcherServlet 是Spring MVC 的入口 所有进入Spring Web 的 Request 都经过 DispatcherServlet 需要在 web.xml 中注册 DispatcherServlet <servlet> <servlet-name>dispatherContext</servlet-name> ...
NULL 博文链接:https://iceelor.iteye.com/blog/1266202
hibernate和spring MVC配置整合
Spring MVC 配置 druid 数据源实例
Spring MVC 配置,入门教程. 什么是Spring MVC? Spring MVC属于SpringFrameWork的后续产品,已经融合在Spring Web Flow里面。
SPRING MVC的配置过程详解,并且教你学会整个配置方法
简单的描述了spring mvc的配置示例,不包括注解方法和示例代码
spring mvc配置datasource数据源的三种方式,对spring的数据库连接源配置,有很大帮助,使你更加准确地了解数据源、连接池的实际使用方法
基于spring2.5的采用XML配置的spring MVC项目 基于spring2.5注解实现的spring MVC项目 基于spring 3.0项目开发实例 基于spring 3.0mvc 框架的文件上传实现 Spring中的拦截器
spring 配置多数据源
页面登陆的springmvc实例
<listener-class>org.springframework.web.context.ContextLoaderListener <servlet-name>test <servlet-class>org.springframework.web.servlet.DispatcherServlet <load-on-startup>1 <servlet-name>...
springmvc配置国际化实例,超简单,下载即可用,欢迎下载
《Spring MVC+MyBatis开发从入门到项目实战》分为4篇。第1篇是Java开发环境的搭建,包括JDK的下载与安装、环境变量的配置、MyEclipse的下载与基本配置。第2篇是MyBatis技术入门,包括剖析JDBC的弊端、MyBatis的背景...
首先, 我需要在你心里建立起 Spring MVC 的基本概念. 基于 Spring 的 Web 应用程序接收到 http://localhost:8080/hello.do(事实上请求路径是 /hello.do) 的请求后, Spring 将这个请求交给一个名为 helloController ...
NULL 博文链接:https://gary-bu.iteye.com/blog/2024022