云题海 - 专业文章范例文档资料分享平台

当前位置:首页 > springmvc框架搭建之xml配置说明(spring4+hibernate4)

springmvc框架搭建之xml配置说明(spring4+hibernate4)

  • 62 次阅读
  • 3 次下载
  • 2025/7/15 11:08:45

SpringMVC框架搭建说明

Spring4.1.4 + hibernate4.3.8

1、web.xml配置

程序运行时从web.xml开始,加载顺序为:context-param -> listener -> filter ->structs (如果使用structs的话)-> servlet 如下为web.xml的配置说明

xmlns:web=\xsi:schemaLocation=\

http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd\version=\

bmymis2

contextConfigLocation

classpath:applicationContext-*.xml

org.springframework.web.context.ContextLoaderListener

encodingFilter

org.springframework.web.filter.CharacterEncodingFilter

encoding UTF-8

forceEncoding true

springServlet

org.springframework.web.servlet.DispatcherServlet

contextConfigLocation

classpath*:/spring-mvc.xml

1 //容器启动时首先初始化该servlet

springServlet

/ //表示所有页面都由springmvc处理

/web/login.jsp

404 /404.html

2、applicationContext-common.xml配置:

http://www.springframework.org/schema/beans

http://www.springframework.org/schema/beans/spring-beans-4.0.xsd http://www.springframework.org/schema/context

http://www.springframework.org/schema/context/spring-context-4.0.xsd http://www.springframework.org/schema/aop

http://www.springframework.org/schema/aop/spring-aop-4.0.xsd http://www.springframework.org/schema/tx

http://www.springframework.org/schema/tx/spring-tx-4.0.xsd\

这个配置就可以省略(以下配置包含了配置)-->

class=\

class=\

class=\Processor\ />

expression=\ />

3、application. properties配置

jdbc.driverClassName=org.postgresql.Driver jdbc.url=jdbc:postgresql://ip:5432/数据库名 jdbc.username=postgres jdbc.password=123

hibernate.dialect=org.hibernate.dialect.PostgreSQLDialect hibernate.show_sql=true hibernate.format_sql=false

4、spring-mvc.xml配置

xmlns:context=\ xmlns:mvc=\ xmlns:p=\ xmlns:xsi=\ xmlns:tx=\ 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/tx

http://www.springframework.org/schema/tx/spring-tx-4.0.xsd \

use-default-filters=\>

class=\Resolver\>

搜索更多关于: springmvc框架搭建之xml配置说明(spring4+ 的文档
  • 收藏
  • 违规举报
  • 版权认领
下载文档10.00 元 加入VIP免费下载
推荐下载
本文作者:...

共分享92篇相关文档

文档简介:

SpringMVC框架搭建说明 Spring4.1.4 + hibernate4.3.8 1、web.xml配置 程序运行时从web.xml开始,加载顺序为:context-param -> listener -> filter ->structs (如果使用structs的话)-> servlet 如下为web.xml的配置说明

× 游客快捷下载通道(下载后可以自由复制和排版)
单篇付费下载
限时特价:10 元/份 原价:20元
VIP包月下载
特价:29 元/月 原价:99元
低至 0.3 元/份 每月下载150
全站内容免费自由复制
VIP包月下载
特价:29 元/月 原价:99元
低至 0.3 元/份 每月下载150
全站内容免费自由复制
注:下载文档有可能“只有目录或者内容不全”等情况,请下载之前注意辨别,如果您已付费且无法下载或内容有问题,请联系我们协助你处理。
微信:fanwen365 QQ:370150219
Copyright © 云题海 All Rights Reserved. 苏ICP备16052595号-3 网站地图 客服QQ:370150219 邮箱:370150219@qq.com