Skip to content

Commit 646c353

Browse files
committed
move source code
1 parent b768b96 commit 646c353

File tree

222 files changed

+539
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

222 files changed

+539
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
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.xingyun</groupId>
7+
<artifactId>spring-boot-web-jsp-sample</artifactId>
8+
<version>0.0.1-SNAPSHOT</version>
9+
<packaging>war</packaging>
10+
11+
<name>spring-boot-web-jsp-sample</name>
12+
<description>Demo project for Spring Boot</description>
13+
14+
<parent>
15+
<groupId>org.springframework.boot</groupId>
16+
<artifactId>spring-boot-starter-parent</artifactId>
17+
<version>2.0.1.RELEASE</version>
18+
<relativePath/> <!-- lookup parent from repository -->
19+
</parent>
20+
21+
<properties>
22+
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
23+
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
24+
<java.version>1.8</java.version>
25+
</properties>
26+
27+
<dependencies>
28+
<!-- Web 项目所以添加Spring MVC Web模块支持-->
29+
<dependency>
30+
<groupId>org.springframework.boot</groupId>
31+
<artifactId>spring-boot-starter-web</artifactId>
32+
</dependency>
33+
34+
<!--jsp页面使用jstl标签-->
35+
<dependency>
36+
<groupId>javax.servlet</groupId>
37+
<artifactId>jstl</artifactId>
38+
</dependency>
39+
40+
<!--Provided start-->
41+
<!--War包部署到外部的Tomcat中已经包含了这些,
42+
所以需要添加以下依赖
43+
否则会和内嵌的Tomcat 容器发生冲突
44+
-->
45+
<dependency>
46+
<groupId>org.springframework.boot</groupId>
47+
<artifactId>spring-boot-starter-tomcat</artifactId>
48+
<scope>provided</scope>
49+
</dependency>
50+
<!--用于编译jsp-->
51+
<dependency>
52+
<groupId>org.apache.tomcat.embed</groupId>
53+
<artifactId>tomcat-embed-jasper</artifactId>
54+
<scope>provided</scope>
55+
</dependency>
56+
<!--Provided End-->
57+
<dependency>
58+
<groupId>org.springframework.boot</groupId>
59+
<artifactId>spring-boot-starter-test</artifactId>
60+
<scope>test</scope>
61+
</dependency>
62+
</dependencies>
63+
64+
<build>
65+
<plugins>
66+
<plugin>
67+
<groupId>org.springframework.boot</groupId>
68+
<artifactId>spring-boot-maven-plugin</artifactId>
69+
</plugin>
70+
</plugins>
71+
</build>
72+
73+
</project>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
package com.xingyun.springbootwebjspsample;
2+
3+
import org.springframework.boot.builder.SpringApplicationBuilder;
4+
import org.springframework.boot.web.servlet.support.SpringBootServletInitializer;
5+
6+
public class ServletInitializer extends SpringBootServletInitializer {
7+
8+
@Override
9+
protected SpringApplicationBuilder configure(SpringApplicationBuilder application) {
10+
return application.sources(SpringBootWebJspSampleApplication.class);
11+
}
12+
13+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
package com.xingyun.springbootwebjspsample;
2+
3+
import org.springframework.boot.SpringApplication;
4+
import org.springframework.boot.autoconfigure.SpringBootApplication;
5+
6+
@SpringBootApplication
7+
public class SpringBootWebJspSampleApplication {
8+
9+
public static void main(String[] args) {
10+
SpringApplication.run(SpringBootWebJspSampleApplication.class, args);
11+
}
12+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
package com.xingyun.springbootwebjspsample.controller;
2+
3+
import org.springframework.stereotype.Controller;
4+
import org.springframework.web.bind.annotation.GetMapping;
5+
6+
@Controller
7+
public class HomeController {
8+
9+
@GetMapping("/")
10+
public String home(){
11+
return "index";
12+
}
13+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
spring.mvc.view.prefix=/WEB-INF/views/
2+
spring.mvc.view.suffix=.jsp
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
<%--
2+
Created by IntelliJ IDEA.
3+
User: fairy
4+
Date: 4/6/2018
5+
Time: 9:56 AM
6+
To change this template use File | Settings | File Templates.
7+
--%>
8+
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
9+
<html>
10+
<head>
11+
<title>Title</title>
12+
</head>
13+
<body>
14+
Hello World,Spring Boot 2.0 JSP Sample
15+
</body>
16+
</html>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
package com.xingyun.springbootwebjspsample;
2+
3+
import org.junit.Test;
4+
import org.junit.runner.RunWith;
5+
import org.springframework.boot.test.context.SpringBootTest;
6+
import org.springframework.test.context.junit4.SpringRunner;
7+
8+
@RunWith(SpringRunner.class)
9+
@SpringBootTest
10+
public class SpringBootWebJspSampleApplicationTests {
11+
12+
@Test
13+
public void contextLoads() {
14+
}
15+
16+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
target/
2+
!.mvn/wrapper/maven-wrapper.jar
3+
4+
### STS ###
5+
.apt_generated
6+
.classpath
7+
.factorypath
8+
.project
9+
.settings
10+
.springBeans
11+
.sts4-cache
12+
13+
### IntelliJ IDEA ###
14+
.idea
15+
*.iws
16+
*.iml
17+
*.ipr
18+
19+
### NetBeans ###
20+
nbproject/private/
21+
build/
22+
nbbuild/
23+
dist/
24+
nbdist/
25+
.nb-gradle/
Binary file not shown.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
distributionUrl=https://repo1.maven.org/maven2/org/apache/maven/apache-maven/3.5.3/apache-maven-3.5.3-bin.zip

0 commit comments

Comments
 (0)