Spring MVC 环境搭建
2021-03-09 05:27
标签:java ret 驱动加载 dir 准备工作 word cte git index 创建好的Maven项目: 首先要在main下创建两个文件夹:java,resources/config(标准是resources) 然后把Java文件用Make Directory as设置为Sources Root 把resources用Make Directory as设置为Resources Root 准备工作做好,主要步骤: 1、POM.xml中添加相应的依赖 2、在web.xml中配置DispatcherServlet 3、在resource目录中新建Springmvc的配置文件 测试 添加tomcat访问localhost:8080/test/index 访问成功则说明Spring-MVC搭建成功 Spring MVC 环境搭建 标签:java ret 驱动加载 dir 准备工作 word cte git index 原文地址:https://www.cnblogs.com/1372841965ZQ/p/14185971.html
junit
spring-context
spring-webmvc
spring-test
spring-jdbc
mysql-connector-java
mybatis-spring
mybatis
commons-dbcp
pagehelper
javax.servlet-api
jsp-api
jstl
standard
mybatis-generator-core
log4j
commons-logging
xmlns:context="http://www.springframework.org/schema/context"
xmlns:mvc="http://www.springframework.org/schema/mvc"
xsi:schemaLocation="http://www.springframework.org/schema/beans
https://www.springframework.org/schema/beans/spring-beans.xsd
http://www.springframework.org/schema/context
https://www.springframework.org/schema/context/spring-context.xsd
http://www.springframework.org/schema/mvc
https://www.springframework.org/schema/mvc/spring-mvc.xsd">
java文件夹新建com.controller包,包下新建
TestController.javapackage com.controller;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
/**
* Created by Tired on 2018/8/3.
*/
@Controller
@RequestMapping("test")
public class TestController {
@RequestMapping("/index")
public String index()
{
return "index";
}
}
webapp下新增admin文件夹,下新建index.jsp
上一篇:Delphi中的各种路径