gradle创建web工程
-
配置环境
-
添加插件
-
build.gradle中添加依赖
dependencies { implementation 'org.springframework:spring-beans:4.1.7.RELEASE' implementation 'org.springframework:spring-web:4.1.7.RELEASE' implementation 'org.springframework:spring-webmvc:4.1.7.RELEASE' implementation 'org.springframework:spring-tx:4.1.7.RELEASE' implementation 'org.springframework:spring-test:4.0.5.RELEASE' implementation 'org.springframework:spring-jdbc:4.1.7.RELEASE' implementation 'org.mybatis:mybatis-spring:1.2.3' implementation 'org.mybatis:mybatis:3.3.0' implementation 'mysql:mysql-connector-java:5.1.36' implementation 'com.alibaba:druid:1.0.15' implementation "com.fasterxml.jackson.core:jackson-databind:2.2.3" implementation "com.fasterxml.jackson.core:jackson-annotations:2.2.3" implementation "com.fasterxml.jackson.core:jackson-core:2.2.3" implementation 'org.aspectj:aspectjweaver:1.8.6' implementation 'log4j:log4j:1.2.17' implementation 'org.slf4j:slf4j-api:1.7.25' implementation 'jstl:jstl:1.2' compileOnly 'javax.servlet:servlet-api:2.5' testImplementation 'org.junit.jupiter:junit-jupiter-api:5.8.1' testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine:5.8.1' }
-
main文件夹下新建webapp文件夹,再新建WEB-INF文件夹,再新建web.xml
-
resource路径下新建
applicationContext.xml springmvc.xml mybatis-config.xml jdbc.properties
- 最后编写业务逻辑即可
【推荐】国内首个AI IDE,深度理解中文开发场景,立即下载体验Trae
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】抖音旗下AI助手豆包,你的智能百科全书,全免费不限次数
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步
· 阿里巴巴 QwQ-32B真的超越了 DeepSeek R-1吗?
· 10年+ .NET Coder 心语 ── 封装的思维:从隐藏、稳定开始理解其本质意义
· 【设计模式】告别冗长if-else语句:使用策略模式优化代码结构
· 字符编码:从基础到乱码解决
· 提示词工程——AI应用必不可少的技术