步骤
- 创建maven webapp 项目
- 在pom.xml添加东西
- 添加tomcat 或者 其他的应用服务器
- 创建java 和resource 的文件夹
- 将文件夹变成特殊文件夹
- 创建包
- 写controller文件(java类),写spring的xml文件(在resources下的文件,一般是-servelt.xml),写web.xml文件
依赖
| <dependencies> |
| <dependency> |
| <groupId>junit</groupId> |
| <artifactId>junit</artifactId> |
| <version>4.11</version> |
| <scope>test</scope> |
| </dependency> |
| <dependency> |
| <groupId>org.springframework</groupId> |
| <artifactId>spring-core</artifactId> |
| <version>5.0.9.RELEASE</version> |
| </dependency> |
| <dependency> |
| <groupId>org.springframework</groupId> |
| <artifactId>spring-web</artifactId> |
| <version>5.0.9.RELEASE</version> |
| </dependency> |
| <dependency> |
| <groupId>org.springframework</groupId> |
| <artifactId>spring-webmvc</artifactId> |
| <version>5.0.9.RELEASE</version> |
| </dependency> |
| <dependency> |
| <groupId>org.springframework</groupId> |
| <artifactId>spring-context</artifactId> |
| <version>5.0.9.RELEASE</version> |
| </dependency> |
| <dependency> |
| <groupId>org.springframework</groupId> |
| <artifactId>spring-aop</artifactId> |
| <version>5.0.9.RELEASE</version> |
| </dependency> |
| <dependency> |
| <groupId>org.springframework</groupId> |
| <artifactId>spring-beans</artifactId> |
| <version>5.0.9.RELEASE</version> |
| </dependency> |
| </dependencies> |
我的问题:由于没有配置好依赖,一直报500错误
web.xml
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】凌霞软件回馈社区,博客园 & 1Panel & Halo 联合会员上线
【推荐】抖音旗下AI助手豆包,你的智能百科全书,全免费不限次数
【推荐】博客园社区专享云产品让利特惠,阿里云新客6.5折上折
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步
· PowerShell开发游戏 · 打蜜蜂
· 在鹅厂做java开发是什么体验
· 百万级群聊的设计实践
· WPF到Web的无缝过渡:英雄联盟客户端的OpenSilver迁移实战
· 永远不要相信用户的输入:从 SQL 注入攻防看输入验证的重要性