关键词:eclipse+maven+spring mvc
资源:
1. https://github.com/spring-projects/spring-framework/wiki/Spring-Framework-Artifacts
2. https://repo.spring.io/webapp/#/artifacts/browse/tree/General/libs-milestone
具体介绍
MVC全名是Model View Controller,是模型(model)-视图(view)-控制器(controller)的缩写,
Model- 模型包含了应用程序的核心数据。数据可以是单个对象,也可以是一组对象。
Controller - 包含了应用程序的业务逻辑。你可以使用 @Controller 注释来标记该类为 Controller。
View - 基本上,视图是用来表示特定格式的信息。在这里,你可以使用JSP+JSTL来创建一个视图页面。
前端控制器 - 在Spring Web MVC中,DispatcherServlet类作为前端控制器工作。
Model – Model contains the core data of the application. Data can either be a single object or a group of objects.
Controller – It contains the business logic of an application. You can use @Controller annotation to mark the class as Controller.
View – Basically, the View is used to represent the information in a particular format. Here, you can use JSP+JSTL to create a view page.
Front Controller – In Spring Web MVC, the DispatcherServlet class works as the front Controller.
方法1:https://www.bilibili.com/video/BV1R4411E7gQ?from=search&seid=12534786194527526873
1.配置环境变量,maven;
2.Source Folder 概念
Source Folder里的文件会被编译或复制到builder class目录,编译后的文件是透明的——即不存在src/mian/java 等包的概念,这里同一个项目里的包的各个文件名不可以同名!
3.创建一个web app
结果:在运行后报错,估计初步定位是tomcat7的原因。
方法2:https://www.jb51.net/article/169893.htm
在配置setting时失败,后面的包也失败,估计是build。
方法3:https://blog.csdn.net/qq_26687255/article/details/90054165
这里基本没问题。
src/main/java //主体代码,如java类
src/main/resources //资源文件:如application.properties,放置密码之类
src/test/java //测试代码,如test.java
src/main/webapp //前端文件,如html,jsp,css
这里报错了。