Course Catalogue and:01. Spring Boot Hello world_ HD. mp402. Spring Boot Returns JSON data _ HD. mp403, Spring Boot Perfect use Fastjson parsing JSON data _ HD. mp404, Spring
controllersrc/mainunder Create a new package cn.zxuqian.controllers and create a new class in it, name HelloController and add the following code:package cn.zxuqian.controllers;import org.springframework.web.bind.annotation.RequestMapping;import org.springframework.web.bind.annotation.RestController;@RestControllerpublicclass HelloController { @RequestMapping("/") publicindex() { return"Hello World!"; } }
@RestControllerMark this class as a rest controller and be rea
the Bean based on conditions such as jar packages, classes, and configuration files in the project classpath, such as: If the classpath has MyBatis and Oracle driver packages, Springboot automatically configures beans such as MyBatis's data source factory . Spring Boot's automatic assembly is implemented primarily through conditional configuration and annotations, which is the magic of Springboot. Simply put, what you need to add dependencies, as lo
configuration file:Management.context-path=/endpointsTo start the test:3.6 Endpoint Protection3.3.6.1 using springsecurity configuration ItemsApplication security mechanism, we can use Spring security,Spring security is for the entire application, after use to access the application, the HTTP Basic Authentication dialog box will pop up. L Join DependencyL Join ConfigurationSecurity.user.name=adminSecurity.
The 1th Chapter Spring Boot Introduction1-1 Spring Boot Blog _ Course GuideWhat is 1-2 Spring Boot?2nd. Opening Spring Boot's first WEB project2-1-Initialize the first web project2-2-Co
Spel
N
Y
ProfilesSpring profile can divide the application's configuration into multiple parts, only in the specified environment. Any @component or @configutaion can use @profile to restrict its loading, for example@Configuration@Profile("production")public class ProductionConfiguration {// ...}You can use spring.profiles.active the Environment variable settings to activate which profile. For example, setting in Application.propertiesspring.profiles.active=d
Spring Boot war package instance tutorial, springwar
In addition to executable jar packages, Spring Boot also supports traditional war packages. This article describes how to use Spring Boot
Spring Boot Basics Tutorial1th QuarterInstallation and use of toolsSpring Boot Documenthttps://qbgbook.gitbooks.io/spring-boot-reference-guide-zh/content/I.%20Spring%20Boot%20Documentation/I. Tools used in the courseSpring Tool Suite:https://spring.io/tools/sts/allEclipse:ht
1: It is easy to read the configuration of the custom properties in the Application.properties, so there are not too many descriptions here:Custom properties and loadingFor example, define the following properties:
com.blog.title=spring Boot Tutorial
The corresponding configuration properties are then loaded by @Value ("${Property Name}") annotations, as follows
4. JSP The custom error page cannot overwrite the spring boot default error page
Four. Jsp Demo to Add configuration parameters:Spring.mvc.view.prefix:/web-inf/templates/Spring.mvc.view.suffix:. jspFollow the public number:650) this.width=650; "src=" Http://s5.51cto.com/wyfs02/M02/89/89/wKiom1gW9oDDdQUFAABtN-e5hXo162.jpg "title=" Dragon Fruit Academy qr code. JPG "alt=" wkiom1gw9odddqufaabtn-e5
("From Production profiles"); }}4> test (Src/test/java) Packagecom.wisely.highlight_spring4.ch3.fortest;ImportOrg.junit.Assert;Importorg.junit.Test;ImportOrg.junit.runner.RunWith;Importorg.springframework.beans.factory.annotation.Autowired;ImportOrg.springframework.test.context.ActiveProfiles;Importorg.springframework.test.context.ContextConfiguration;ImportOrg.springframework.test.context.junit4.SpringJUnit4ClassRunner; the @RunWith (Springjunit4classrunner.class)//Springjunit4classrunner prov
Jedisconnectionfactory ();
}
@Bean public
redistemplate
After the configuration is completed, write the test case experiment effect@RunWith (Springjunit4classrunner.class)
@SpringApplicationConfiguration (application.class) Public
class applicationtests {
@Autowired
private redistemplate Of course the data operations provided in Spring-data-redis are much more than this, this article is only used as a configuration reference w
--- [ restartedMain] com.ysl.jna.jna.JnaApplicationKt : Started JnaApplicationKt in 7.447 seconds (JVM running for 8.208)Indicates that your app has started successfully; the second-to-last line of debugging information is as follows:2017-12-23 13:30:39.642 INFO 6788 --- [ restartedMain] o.s.b.w.embedded.tomcat.TomcatWebServer : Tomcat started on port(s): 8080 (http) with context path ‘‘You will see spring
values for No limit) spring.redis.pool.max-active=8# connection pool maximum blocking wait time (using negative values means there is no limit) spring.redis.pool.max-wait=-1# The maximum idle connection in the connection pool spring.redis.pool.max-idle=8# the minimum idle connection in the connection pool spring.redis.pool.min-idle=0# connection time-out (in milliseconds) spring.redis.timeout =0 Where the configuration of spring.redis.database usually uses 0, Redis can set the number of databa
Intellij IDEA graphic tutorial for creating a spring-boot project,
Development Environment:
Jdk: jdk 8
Maven: maven-3.5.2
Development Tool: Itellij IDEA 2017.1.
Prerequisites: you have installed the above software and configured the jdk and maven environment variables.
Procedure:
Click Upload file --- Select new --- and click project..., as shown in:
Cli
to be monitored to joinCreate a spring boot app to monitorThe following dependencies are added to the Pom.xml?
12345
dependency > NBSP; groupid >de.codecentric groupid > NBSP; artifactid >spring-boot-admin-starter-client artifactid > NBSP; version >1.5.7 version > dependency >
pk1640-Dragon Fruit Spring Boot Tutorial CompleteDocking real data from 0 development front-end separation Enterprise-class online projectThe beginning of the new year, learning to be early, drip records, learning is progress!Essay background: In a lot of times, many of the early friends will ask me: I am from other languages transferred to the development of the
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.