Springboot-web Project

Source: Internet
Author: User

One: Use Thymeleaf: Reference http://blog.csdn.net/u012702547/article/details/53784992#t0

1.1 Introducing the appropriate package

1.2 Thymeleaf Configuration

1) Configuration class mode

@ConfigurationProperties ("Spring.thymeleaf") Public classthymeleafproperties {Private StaticFinal Charset default_encoding = Charset.forname ("UTF-8"); Private StaticFinal MimeType Default_content_type = mimetype.valueof ("text/html");  Public StaticFinal String Default_prefix ="classpath:/templates/";  Public StaticFinal String Default_suffix =". html"; PrivateBoolean checktemplate =true; PrivateBoolean checktemplatelocation =true; PrivateString prefix ="classpath:/templates/"; PrivateString suffix =". html"; PrivateString mode ="HTML5"; ......    ......    ......}
View Code

2) configuration file

Application.properties file with Spring.thymeleaf as prefix to configure related properties

1.3 Tomcat Configuration

server.port=8081#配置服务器端口, the default is 8080server.session-timeout=1000000#用户回话session过期时间, Configure access path in seconds server.context-path=/index#, default =/Server.tomcat.uri-encoding=utf-8#配置Tomcat编码, Default is utf-8server.tomcat.compression=on#tomcat Whether compression is turned on, default is off

1.2 Working principle

Backstage by putting JavaBean or other Java objects into the model object, the foreground page can get values through ${javabean.name}, and there are many ways to use

   

Springboot-web Project

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.