深入理解Springboot

package com.example.first.hello;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
@RestController
public class Helloworld {
@RequestMapping("/users/demo")
public String data() {
String result = “\r\n” +
“<html lang=“zh-CN”>\r\n” +
“\r\n” +
“\r\n” +
" <meta charset=“utf-8”>\r\n" +
" <meta http-equiv=“x-ua-compatible” content=“ie=edge”>\r\n" +
" HTML模板文件\r\n" +
" <meta name=“viewport” content=“width=device-width, initial-scale=1”>\r\n" +
“\r\n” +
“\r\n” +
“\r\n” +
"

\r\n" +
" <tr style=“color:red”>\r\n" +
" \r\n" +
" \r\n" +
" \r\n" +
" \r\n" +
" \r\n" +
"
1 1 1 1
\r\n" +
“\r\n” +
“\r\n” +
“\r\n” +
“”;
return result;
}
}
运行结果
在这里插入图片描述
pom.xml

<?xml version="1.0" encoding="UTF-8"?>


4.0.0

org.springframework.boot
spring-boot-starter-parent
2.1.2.RELEASE


com.example
first
0.0.1-SNAPSHOT
first
Demo project for Spring Boot

<java.version>1.8</java.version>



org.springframework.boot
spring-boot-starter-web

	<dependency>
		<groupId>org.springframework.boot</groupId>
		<artifactId>spring-boot-starter-test</artifactId>
		<scope>test</scope>
	</dependency>
</dependencies>
<build>
	<plugins>
		<plugin>
			<groupId>org.springframework.boot</groupId>
			<artifactId>spring-boot-maven-plugin</artifactId>
		</plugin>
	</plugins>
</build>

猜你喜欢

转载自blog.csdn.net/weixin_37565521/article/details/86475661
今日推荐