springmvc基本配置
来源:互联网 发布:linux firefox找不到 编辑:程序博客网 时间:2024/06/06 16:52
web.xml
<?xml version="1.0" encoding="UTF-8"?><web-app version="2.5" xmlns="http://java.sun.com/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"> <display-name></display-name><!-- 配置SpringMVC --><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:springmvc.xml</param-value></init-param><load-on-startup>1</load-on-startup></servlet><servlet-mapping><servlet-name>springmvc</servlet-name><!-- 所有访问的地址都由DispatcherServlet进行解析 --><url-pattern>/</url-pattern></servlet-mapping> <!-- post乱码过虑器 --><filter><filter-name>CharacterEncodingFilter</filter-name><filter-class>org.springframework.web.filter.CharacterEncodingFilter</filter-class><init-param><param-name>encoding</param-name><param-value>UTF-8</param-value></init-param></filter><filter-mapping><filter-name>CharacterEncodingFilter</filter-name><url-pattern>/*</url-pattern></filter-mapping> </web-app>
springmvc.xml
<beans xmlns="http://www.springframework.org/schema/beans"xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:mvc="http://www.springframework.org/schema/mvc"xmlns:context="http://www.springframework.org/schema/context"xmlns:aop="http://www.springframework.org/schema/aop" xmlns:tx="http://www.springframework.org/schema/tx"xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.2.xsd http://www.springframework.org/schema/mvc http://www.springframework.org/schema/mvc/spring-mvc-3.2.xsd http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-3.2.xsd http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-3.2.xsd http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-3.2.xsd "><!-- 配置Controller扫描 --><context:component-scan base-package="com.controller"></context:component-scan><!-- 配置注解驱动 --><mvc:annotation-driven ></mvc:annotation-driven><!-- 视图解析器解析jsp解析,默认使用jstl标签,classpath下的得有jstl的包 --><beanclass="org.springframework.web.servlet.view.InternalResourceViewResolver"><!-- 配置jsp路径的前缀 --><property name="prefix" value="/WEB-INF/jsp/"/><!-- 配置jsp路径的后缀 --><property name="suffix" value=".jsp"/></bean><!-- 配置资源映射 --><mvc:resources location="/css/" mapping="/css/**"/><mvc:resources location="/js/" mapping="/js/**"/></beans>
jar包
阅读全文
0 0
- SpringMVC 基本配置
- springMVC基本配置
- SpringMVC+Hibernate基本配置
- springmvc的基本配置
- SpringMVC-基本配置
- SpringMVC基本配置
- springmvc项目基本配置
- SpringMvc Maven基本配置
- springMVC基本配置
- springmvc的基本配置
- SpringMVC基本配置
- SpringMVC基本配置
- SpringMVC基本配置
- springmvc基本配置
- springmvc基本配置
- springMVC基本环境配置
- SpringMvc学习(1) springmvc的基本配置
- SpringMVC 的基本应用配置
- 20171109
- Codeforces Round #398 (Div. 2) 题解
- Fibonacci数列
- 服务器端配置跨域
- 关系运算符和逻辑运算符的应用
- springmvc基本配置
- 创世纪
- 服务器搭建记录
- 算法学习--选择排序和插入排序
- 第三方登录
- 吴恩达Coursera深度学习课程 DeepLearning.ai 提炼笔记(1-3)-- 浅层神经网络(转载)
- 文章标题
- PHP使用Memcache详解
- SQL——视图作用