zoukankan      html  css  js  c++  java
  • spring-mvc.xml中的配置

     1 <?xml version="1.0" encoding="UTF-8"?>
     2 <beans xmlns="http://www.springframework.org/schema/beans"
     3     xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:mvc="http://www.springframework.org/schema/mvc"
     4     xmlns:p="http://www.springframework.org/schema/p" xmlns:context="http://www.springframework.org/schema/context"
     5     xmlns:aop="http://www.springframework.org/schema/aop" xmlns:tx="http://www.springframework.org/schema/tx"
     6     xsi:schemaLocation="http://www.springframework.org/schema/beans
     7             http://www.springframework.org/schema/beans/spring-beans-3.2.xsd
     8             http://www.springframework.org/schema/context
     9             http://www.springframework.org/schema/context/spring-context-3.2.xsd
    10             http://www.springframework.org/schema/aop
    11             http://www.springframework.org/schema/aop/spring-aop-3.2.xsd
    12             http://www.springframework.org/schema/tx
    13             http://www.springframework.org/schema/tx/spring-tx-3.2.xsd
    14             http://www.springframework.org/schema/mvc
    15             http://www.springframework.org/schema/mvc/spring-mvc-3.2.xsd
    16             http://www.springframework.org/schema/context
    17             http://www.springframework.org/schema/context/spring-context-3.2.xsd">
    18 
    19     <!-- 使Spring支持自动检测组件,如注解的Controller -->
    20     <context:component-scan base-package="cn.smart.webapp.controller" />
    21     <context:annotation-config />
    22 
    23 
    24     <!--避免IE执行AJAX时,返回JSON出现下载文件 -->
    25     <bean id="mappingJacksonHttpMessageConverter"
    26         class="org.springframework.http.converter.json.MappingJacksonHttpMessageConverter">
    27         <property name="supportedMediaTypes">
    28             <list>
    29                 <value>text/html;charset=UTF-8</value>
    30             </list>
    31         </property>
    32     </bean>
    33 
    34 
    35     <!-- 启动SpringMVC的注解功能,完成请求和注解POJO的映射 -->
    36     <bean
    37         class="org.springframework.web.servlet.mvc.annotation.AnnotationMethodHandlerAdapter">
    38         <property name="messageConverters">
    39             <list>
    40                 <ref bean="mappingJacksonHttpMessageConverter" /> <!-- JSON转换器 -->
    41             </list>
    42         </property>
    43     </bean>
    44 
    45 
    46     <!-- jsp视图解析器 -->
    47     <bean id="jspViewResolver"
    48         class="org.springframework.web.servlet.view.InternalResourceViewResolver">
    49         <property name="viewClass"
    50             value="org.springframework.web.servlet.view.JstlView" />
          //下面value中的是jsp所在的路径
    51         <property name="prefix" value="WEB-INF/view/" />
    52         <property name="suffix" value=".jsp" />
    53 
    54     </bean>
    55 </beans>
  • 相关阅读:
    JQUERY1.9学习笔记 之基本过滤器(八) 最后元素选择器
    解决接收参数乱码,tomcat的URIEncoding=UTF-8
    mac下配置maven
    [forwarding] Struts2中action接收中文参数为乱码解决方法
    [forwarding]软考复习之软件架构风格
    [forwarding]Write operations are not allowed in read-only mode 只读模式下(FlushMode.NEVER/MANUAL)写操作不允许问题
    [forwarding]详解Linux命令行下常用svn命令
    [forwarding]mysql用户授权
    【转】Hibernate 查询语言Query Language(HQL)
    java.lang.NoSuchMethodError: antlr.collections.AST.getLine()I错误
  • 原文地址:https://www.cnblogs.com/MrzhangKk/p/5274892.html
Copyright © 2011-2022 走看看