IntellJ IDEA+Spring Boot+JSP
来源:互联网 发布:手机游戏端口 编辑:程序博客网 时间:2024/06/06 11:37
一、创建Web项目在IntellJ IDEA
1. File -> New -> Project
2.创建maven项目
3.填写groupid, artifactid,version.
4.预览project
5.完成创建
6.配置项目,添加一些文件夹。 默认是没有src/main/java
File -> Project Structrue -> Modules -> Demo -> 右键创建folder -> mark as Sources
项目结构:
二、创建Spring boot 项目
1. pom.xml内容,dependency
<?xml version="1.0" encoding="UTF-8"?><project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> <modelVersion>4.0.0</modelVersion> <groupId>com.test</groupId> <artifactId>Demo</artifactId> <version>1.0-SNAPSHOT</version> <parent> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-parent</artifactId> <version>1.4.6.RELEASE</version> </parent> <dependencies> <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-web</artifactId> </dependency> <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-tomcat</artifactId> <scope>provided</scope> </dependency> <dependency> <groupId>org.apache.tomcat.embed</groupId> <artifactId>tomcat-embed-jasper</artifactId> </dependency> </dependencies> <properties> <java.version>1.8</java.version> </properties> <build> <plugins> <plugin> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-maven-plugin</artifactId> </plugin> </plugins> </build></project>
2. MyApplication.java
@SpringBootApplicationpublic class MyApplication { public static void main(String[] args) { SpringApplication.run(MyApplication.class, args); }}
@Controllerpublic class IndexController { @RequestMapping("/index") public String testIndex(){ return "index"; }}
spring.mvc.view.prefix=/WEB-INF/jsp/spring.mvc.view.suffix=.jsp
6.运行MyApplication.java,在网址输入http://localhost:8080/index
阅读全文
0 0
- IntellJ IDEA+Spring Boot+JSP
- spring boot+ Intellj idea devtool 设置热部署
- spring boot+ Intellj idea devtool 设置热部署
- spring boot+ Intellj idea devtools 设置热部署
- IDEA Spring-Boot没有JSP
- IDEA spring boot+jsp 404
- 使用IDEA在Spring Boot中集成JSP
- 使用IDEA在Spring Boot上集成JSP
- 使用IDEA在Spring Boot中集成JSP
- IDEA spring-boot jpa jsp 框架搭建(一)
- IDEA spring-boot jpa jsp 框架搭建(二)
- IDEA spring-boot jpa jsp 框架搭建(三)
- spring-boot idea demo
- Spring boot+Spring MVC+Idea
- Intellj IDEA常用快捷键
- Intellj IDEA Shortcut Key
- IntellJ IDEA 所有快捷键
- intellj idea快捷键
- 多线程交替执行
- unity消息系统机制,工具类可以直接使用
- 阿斯麦电面 面经(附自己的一些总结)
- HTML表单元素
- 为服务器上的图片生成二维码
- IntellJ IDEA+Spring Boot+JSP
- 关于js的报错处理
- lua写入一个不确定是否存在文件的方法
- 求树的直径
- 从CNN视角看在自然语言处理上的应用
- 国内外研究现状和发展趋势
- SQLServer 测试
- Ubuntu 16.04 :shadowsockets + chrome 代理
- vim常用命令和配置