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 main contents of this chapter:With previous learning, we learned and quickly completed the first spring boot application. Spring Boot Enterprise Framework, then how does spring boot read static resources? such as JS folder, CS
When we are doing Web applications, it is very common for errors to occur during request processing. Spring Boot provides a default mapping: When an exception is thrown in processing, it is /error forwarded to the request for processing, and the request has a global error page to display the exception content.Choose a previously implemented
; import org. springframework. boot. autoconfigure. springBootApplication; @ SpringBootApplicationpublic class App {public static void main (String [] args) {SpringApplication. run (App. class, args );}}
Enter the following content in HelloController. java:
package com.hang.controller;import org.springframework.web.bind.annotation.GetMapping;import org.springframework.web.bind.annotation.RestController;@RestControllerpublic class HelloController {
Rookie new to the big God do not spray, a little Daigo, grateful. Because I always pretend to be humorous, because I want to make myself happy.
Spring MVC, which is provided by the spring boot, does not meet its own requirements, and it can write a control class plus @EnableWebMvc annotations to control the MVC configuration itself.
Use Spring Boot to develop "Hello World" Web applications, springhelloEnvironment preparation
Because many ides currently support Maven, we will use Maven to build this project;
Before you start, install Java and Maven:
This project will be developed based on Spring Boot 1.4
Create a Web projectConfiguring the Pom.xml file------equivalent to a jar packageConfigure APPLICATION.YML-----Profile (Spring database connection, Server service, logging log, etc.)Create package (entity, Controller, service, configuration, repository, interceptor, etc.)Small example:Entity:personData Persistence (DAO):ControllerSpring comes with JUnit test @springboottest without having to configure JUnit
The main contents of this chapter:With previous learning, we learned and quickly completed the first spring boot application. Spring Boot Enterprise Framework, then how does spring boot read static resources? such as JS folder, CS
ObjectiveThe simple use of spring Boot as early as last year was shocked by its handy features. But that is also not in-depth research, as its application in the industry more and more widely, so decided to study deeply, will own learning experience in this record, this article mainly around the following points to explain:
About Spring
In the previous two blogs we briefly introduced the Spring Boot project creation, and also with small partners to DIY a spring boot auto-configuration feature, then these things ultimately will return to the web to reflect its greater value, so, Today we'll look at how to us
When we used the spring framework before, we needed to add dependency dependencies to the Pom file, and then create a new spring-related XML file, often with fewer XML files. Then continue to use Tomcat or jetty as a container to run the project. Basically creating a new project every time is such a process, and we sometimes just want to quickly create a spring
actually, after all, HTTP is a character-based protocol, and its parsing speed is not as good as the binary protocol. At the same time, the spring boot based on Tomcat and SPRINGMVC is also relatively bulky and cumbersome. But the popularity of spring boot in recent years suggests that the Java
Recently in learning Spring boot-related technology, just touch on a kind of brief encounter feeling, because the project is built with spring boot is too convenient, we often only need a few simple steps, we can complete a spring MVC project to build, feel is:OK, the follow
according to the group all the differences that the user fills in when the project is generated): src/main/ Program entry under Java: Config file under springboot1application src/main/resources: Application.properties src/test/ Test entry under: springboot1applicationtests
Both the generated springboot1application and Springboot1applicationtests classes can be run directly to start the currently created project, because the project is currently not mated to any data access or
the template engine mainly in the following ways:ThymeleafFreemarkerVelocityGroovyMustacheSpring boot recommends using these template engines to avoid using JSPs, and if you must use JSP, you will not be able to implement many of the features of spring boot, as described later: support for JSP configurationWhen you use any of the above template engines, their de
boot consists of three files (the specific path is based on all the group variances that are filled out when the user builds the project): src/main/ Java Program entry: springboot1application src/main/resources configuration file: Application.properties src/test/ Test entrance below: springboot1applicationtests
The generated springboot1application and Springboot1applicationtests classes can be run directly to start the currently created project, beca
Boot provides the default configuration of the template engine mainly in the following ways:
Thymeleaf
Freemarker
Velocity
Groovy
Mustache
Spring boot recommends using these template engines to avoid using JSPs, and if you must use JSP, you will not be able to implement many of the features of s
(under the project root) where the dependencies section is a dependency configuration: note: The following code is automatically generated without any modification, here is just a description of the configurationdependencies {compile(‘org.springframework.boot:spring-boot-starter-actuator‘)compile(‘org.springframework.boot:spring-boot-
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.