一、创建项目

(File--->New-->Project)

IntelliJ IDEA 2017版 spring-boot加载jsp配置详解(详细图文实例)

2、项目配置内容

IntelliJ IDEA 2017版 spring-boot加载jsp配置详解(详细图文实例)

3、选择配置项目的Group包名,Artifact项目名称

IntelliJ IDEA 2017版 spring-boot加载jsp配置详解(详细图文实例)

4、选择项目类型为web类型

IntelliJ IDEA 2017版 spring-boot加载jsp配置详解(详细图文实例)

5、创建成功,点击最后一步finish

IntelliJ IDEA 2017版 spring-boot加载jsp配置详解(详细图文实例)

二、代码编写

1、搭建pom.xml文件

 1 <?xml version="1.0" encoding="UTF-8"?>
 2 <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
 3          xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
 4     <modelVersion>4.0.0</modelVersion>
 5 
 6     <groupId>com.springboot</groupId>
 7     <artifactId>jsp</artifactId>
 8     <version>0.0.1-SNAPSHOT</version>
 9     <packaging>jar</packaging>
10 
11     <name>jsp</name>
12     <url>http://maven.apache.org</url>
13     <description>Demo project for Spring Boot</description>
14 
15     <parent>
16         <groupId>org.springframework.boot</groupId>
17         <artifactId>spring-boot-starter-parent</artifactId>
18         <version>1.5.9.RELEASE</version>
19         <relativePath/> <!-- lookup parent from repository -->
20     </parent>
21 
22     <properties>
23         <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
24         <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
25         <java.version>1.8</java.version>
26     </properties>
27 
28     <dependencies>
29         <dependency>
30             <groupId>org.springframework.boot</groupId>
31             <artifactId>spring-boot-starter-web</artifactId>
32         </dependency>
33 
34         <dependency>
35             <groupId>org.springframework.boot</groupId>
36             <artifactId>spring-boot-starter-test</artifactId>
37             <scope>test</scope>
38         </dependency>
39 
40         <!-- servlet 依赖. -->
41         <dependency>
42             <groupId>javax.servlet</groupId>
43             <artifactId>javax.servlet-api</artifactId>
44             <scope>provided</scope>
45         </dependency>
46 
47         <!--
48                 JSTL(JSP Standard Tag Library,JSP标准标签库)是一个不断完善的开放源代码的JSP标签库,是由apache的jakarta小组来维护的。
49          -->
50         <dependency>
51             <groupId>javax.servlet</groupId>
52             <artifactId>jstl</artifactId>
53         </dependency>
54 
55         <!-- tomcat 的支持.-->
56         <dependency>
57             <groupId>org.springframework.boot</groupId>
58             <artifactId>spring-boot-starter-tomcat</artifactId>
59             <scope>provided</scope>
60         </dependency>
61 
62         <dependency>
63             <groupId>org.apache.tomcat.embed</groupId>
64             <artifactId>tomcat-embed-jasper</artifactId>
65             <!--<scope>provided</scope>-->
66         </dependency>
67 
68         <dependency>
69             <groupId>org.eclipse.jdt.core.compiler</groupId>
70             <artifactId>ecj</artifactId>
71             <version>4.6.1</version>
72             <scope>provided</scope>
73         </dependency>
74 
75     </dependencies>
76 
77     <build>
78         <plugins>
79             <plugin>
80                 <groupId>org.springframework.boot</groupId>
81                 <artifactId>spring-boot-maven-plugin</artifactId>
82             </plugin>
83         </plugins>
84     </build>
85 
86 
87 </project>
View Code

相关文章:

  • 2021-11-25
  • 2021-04-16
  • 2021-11-27
  • 2021-07-02
猜你喜欢
  • 2022-01-12
  • 2021-12-14
  • 2021-12-11
  • 2021-11-19
  • 2021-10-26
  • 2021-07-12
  • 2021-05-04
相关资源
相似解决方案