《一线大厂Java面试题解析+核心总结学习笔记+最新讲解视频+实战项目源码》,点击传送门,即可获取!
org.apache.struts
struts2-core
2.3.35
org.apache.struts
struts2-spring-plugin
2.3.35
org.apache.struts
struts2-json-plugin
2.3.8
1.4 配置Java EE 坐标依赖
这里可以引入 servlet api,jstl 标签库等一系列工具
javax.servlet
javax.servlet-api
3.1.0
provided
javax.servlet.jsp
javax.servlet.jsp-api
2.3.1
provided
org.projectlombok
lombok
1.18.0
provided
jstl
jstl
1.2
taglibs
standard
1.1.2
1.5 其他工具
json 处理工具
org.jetbrains
annotations-java5
RELEASE
compile
org.json
json
20160810
=======================================================================
2.1 配置文件
使用如下方式创建
-
applicationContext.xml
-
jdbc.properties
-
struts.xml
2.2 包结构
创建如下的基本包结构
=======================================================================
3.1 web.xml 文件配置
Archetype Created Web Application
contextConfigLocation
classpath:applicationContext.xml
struts2
org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter
struts2
/*
org.springframework.web.context.ContextLoaderListener
3.2 编写 jdbc.properties 文件
这里我们需要自己手动修改数据库的信息配置
jdbc.driverClass=com.mysql.jdbc.Driver
jdbc.jdbcUrl=jdbc:mysql://localhost:3306/hibernate?characterEncoding=utf-8&autoReconnect=true&useSSL=false
jdbc.use