Discover spring boot starter web reactive, include the articles, news, trends, analysis and practical advice about spring boot starter web reactive on alibabacloud.com
The Web Development Rendering page of Spring boot learning (d) was written in the previous chapter--Thymeleaf
Next, let's take a look at Freemarker integration Springboot
See controller:
@RequestMapping ("/") public
String index (Modelmap map) {
map.addattribute ("name", "Xiao Jin gg");
Return "index";
Pom.xml introduced:
Write a H
The static directory of the spring boot program defaults to the Resources/static directory, which, when packaged as a jar, packs the static directory in such a way that there are some problems:
Too many static files, resulting in too large jar package size
Temporary modification Inconvenient
Looking at the official documentation, you can see that the static can be external.Method 1 Modify
I. Introduction of the Project (demo)MU-Class network ... Hit three words, or not introduced to avoid advertising. A simple crawler for this site's demo.Address: Https://www.imooc.com/course/list?c=springbootII. structure of the projectProject Multilayer Architecture: Common layer, controller layer, entity layer, repository layer, because the demo is relatively simple there is no subdivision so much (lazy). Iii. Description of the projectF12 view the page HTML structure, find the followingThis
We have been using the SSM framework to write Web sites that Access database types, and app,web sites need to have databases to store data.
Let's take a look at the Springboot operation database using JdbcTemplate;
data Source configuration in the configuration file
When we access the database, we need to first configure a data source, the following describes several different ways of database configuration
Web Development Auto-configuration class: Org.springframework.boot.autoconfigure.web.WebMvcAutoConfiguration 1.1. Automatic configuration of the Viewresolver(view parser for SPRINGMVC)Configuration of the View Mvcproperties object: ( Configure the view prefix suffix, which can be configured in the global application.properties )Org.springframework.boot.autoconfigure.web.WebMvcProperties.View1.2 Configuring static resources automaticallyIf the rule to
;The database can be added if the correct conditions are met, otherwise it will be shut down.Second, AOP Unified processing LogAOP is a programming norm , which is independent of language and is a programming idea.Scenario: Record requests for each visitFirst step: Add dependenciesStep two: Define the Aspect class@Aspect @component//The file is referenced to the spring container in the public class Httpaspect {@Before ("Execution (public * Com.test.co
1. Create a Controller class package Com.example.demo; import org.springframework.web.bind.annotation.RequestMapping; import Org.springframework.web.bind.annotation.RestController; /** * Created by Administrator on 2018-06-09. */ @RestController public class Democontroller {@RequestMapping ( "Hello" public String hello () { return "Hello world!" ; }}2. Launch the app, right-click on Demoapplication.java, select Run or debug in the pop-up menu3. Enter the Access address
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.