7.Springboot of web development

To solve the problem:

1. Import static resource ( HTML or the like ( the webapp ))

2. Home

3. No write Jsp local --------> So you want to learn template engine Thymeleaf

4. Assembly extended springmvc

5. CRUD

6. interceptor

7. international (English switching)

 

1. static resources

 

 The following pages put these bag, localhost: 8080 direct access to, / ** is the current directory

 

Public and resources is our own built

 

2. How to customize the home page

I'm used to the public this package to build

Named index.html

 

 This will direct the 8080 visit

 

 

Template engine

Now we show you springboot inside how jump page

In the templates directory page only through @Controller , @RequestMapper ( " / Pig " ) for page jumps access and need support template engine

 

The next time you create a project of this to remember to check onThymeleaf

 

 

 

 

Introduced thymeleaf dependence

<! - dependent incorporated thymeleaf ->

        <dependency>

            <groupId>org.springframework.boot</groupId>

            <artifactId>spring-boot-starter-thymeleaf</artifactId>

        </dependency>

 

Well because you want to jump, jump to another page of things to the controller to write inside layer

 

 Here we can see that the jump page to test.html .

 

 Template engine as well as acquisition function values

Now we try to get the value of the template engine

 

 

 test.html

 

 

Guess you like

Origin www.cnblogs.com/tuyaojiao/p/12373338.html