[原创] Struct项目搭建笔记

开发工具:intelliJ IDEA

1.创建一个maven项目

创建一个maven项目

配置项目的maven 坐标

配置项目的maven 坐标

完成后,在项目中添加文件“src/main/java”,“src/main/resources”,“src/test/java”,’“src/test/resources “

添加文件

添加spring

添加spring依赖 Pom文件添加依赖,自动下载jar包

添加spring

配置web.xml文件 配置标签,定义了我们的主页的位置,输入http://localhost:8080自动跳至这个标签配置的页面。定义了一个叫做springMVC的DispatcherSevlet,并初始化变量contextConfiguration,代表我们将这个servlet配置内容放置在了spring文件夹下的spring-mvc.xml中了

配置spring-mvc.xml内容

配置spring-mvc.xml内容

编写helloword

编写helloword