Spring Cloud Spring Boot mybatis distributed micro-service Cloud Architecture (13)

Source: Internet
Author: User

Preparatory work

First, build a simple Web project that you can use to add security controls later, or use the Chapter3-1-2 as a foundation project. If you are building a web app using spring boot, you can first read the article "Spring Boot Development web App".

Web tier Implementation Request mapping

[Java] View plain copy
@Controller
public class Hellocontroller {

@RequestMapping("/")  public String index() {      return "index";  }  @RequestMapping("/hello")  public String hello() {      return "hello";  }  

}

/: Map to Index.html
/hello: Mapping to Hello.html
Implementing a mapped page

Src/main/resources/templates/index.html
[Java] View plain copy
<! DOCTYPE html>
<title>spring Security Primer </title>
<body>
<p> Click <a th:href= "@{/hello}" > here </a> say hello </p>
</body>

Src/main/resources/templates/hello.html
[Java] View plain copy
<! DOCTYPE html>
xmlns:sec= "Http://www.thymeleaf.org/thymeleaf-extras-springsecurity3" >
<title>hello world!</title>
<body>
</body>

You can see the link to/hello in index.html, obviously there is no security control here, so click on the link to jump to the hello.html page directly.

Spring Cloud Spring Boot mybatis distributed micro-service Cloud Architecture (13)

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.