11 11 junit junit 4.11 test org.springframework spring-webmvc 5.3.1 org.springframework spring-web 5.3.1 javax.servlet servlet-api 2.5 provided ch.qos.logback logback-classic 1.2.3 javax.servlet javax.servlet-api 3.1.0 provided
在webapp-WEB-INF下创建web.xml
springmvc org.springframework.web.servlet.DispatcherServlet contextConfigLocation classpath:springmvc.xml springmvc /
在src-main-resources下创建springmvc.xml
在src-main-java-com.controller下创建TestController类
@RestController@RequestMapping("/test")public class TestController {@GetMapping("/hello")public String hello(){return "hello";}}
1、文件(Feild)-项目结构(Project structure)-工件(Artifacts)-Web应用程序:展开型(Web Aplication:Exploded)-基于模块(From Modules)-选择需要配置的模块名称,然后点击Facet-Web下的模块,进行路径配置
2、点击项目右上角编辑配置(Edit Configurations)-左上角±Tomcat服务器(Tomcat Server)-本地(localhost)
3、设置路径
4、设置部署(Deployment)-工件(Artifact),需注意应用程序上下文(Application context)的路径和服务器(Server)中的URL一致
下一篇:神经网络基础