Discover spring boot starter web reactive, include the articles, news, trends, analysis and practical advice about spring boot starter web reactive on alibabacloud.com
DescriptionThe Spring boot framework was recently started, and spring boot came with a servlet container, discovering that, in addition to running the project in Java mode, the Application.java was deployed in a way that would normally be used to launch a Web project to
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
We have experienced a simple RESTful API development service;
To load static resource access
When we develop Web applications, we need to reference a large number of JS, CSS, pictures and other static resources.
Default configuration
Spring boot defaults to provide a static resource directory location to be placed under Classpath, the directory name should confor
A. Spring boot 's Web application development is based on spring MVCtwo. Spring Boot is based on spring default, and the following features are added for automatic configuration:
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. Springboot default error page effect is as follows:Al
Original video reference: Http://www.roncoo.com/course/view/c99516ea604d4053908c1768d6deee3dA. Spring boot 's Web application development is based on spring MVCtwo. Spring Boot is based on s
Spring Boot is a powerful tool for spring QuickStart. Spring boot can help you easily build applications based on spring. Aerospike is a distributed and replicable memory database optimized for either DRAM or native flash/ssd,aero
Original video reference: Http://www.roncoo.com/course/view/c99516ea604d4053908c1768d6deee3dA. Spring boot 's Web application development is based on spring MVCtwo. Spring Boot is based on s
Spring Boot Introductory Web chapter (II)
Original address: Spring Boot Introductory Web chapter (II)Blog address: http://www.extlight.com First, preface
The foundation of Spring
Web Development Auto-configuration class: Org.springframework.boot.autoconfigure.web.WebMvcAutoConfiguration1.1. Automatic configuration of the ViewresolverThe configuration of the View Mvcproperties object:Org.springframework.boot.autoconfigure.web.WebMvcProperties.View1.2. Configure static resource 1.2.1 automatically. Enter rule to/If the rule to enter SPRINGMVC is/, the path to the default static resource for
the default template path and so on. # Enable template caching. Spring.thymeleaf.cache=true # Check The templates location exists. Spring.thymeleaf.check-template-location=true # Content-type value. spring.thymeleaf.content-type=text/html # Enable MVC thymeleaf View resolution. Spring.thymeleaf.enabled=true # Template encoding. Spring.thymeleaf.encoding=utf-8 # comma-separated List of view names that should is excluded from resolution. spring.thymeleaf.excluded-view-names= # Template mode
Spring Boot uses AOP to uniformly handle web layer exceptions.
By default, springboot errors are redirected to the error/error page in the request's returned rendering path.
Source code analysis: DefaultErrorViewResolver. java
private ModelAndView resolve(String viewName, Map
For example, in application. properites, configure the rendering page
# Configure freem
The configuration of the data source can follow the example of the Spring boot Learning (vii) Web application using the JdbcTemplate Datasourceconfig implementation in a multi-data source configuration. Add a new JPA configuration to the first data source, noting two notes where you specify the entity entity and Repository definition location for the data source,
(camera, microphone, etc.), network information, processors, various sensors, etc.
In other words, B2G is a browser-based operating system where you can make phone calls, text messages, video chats, play all kinds of games, and these functions are HTML5.
Obviously, this is a Chrome OS-like project, just b2g for mobile terminals, and Chrome OS is still just a netbook ...
Prospect:
Yes, the most important is the various device APIs, they are the basis of B2G, but, also may let b2g die, be
;Importcom.cfj.testboot.domain.UserDo; @RestController Public classTestreturnjson {@RequestMapping ("/returnjson") PublicUserdo Testreturnjson () {Userdo u=NewUserdo (); U.setid (1); U.settname ("Testers"); returnu; }}The results of the operation are as follows:@RestController annotations, equivalent to @[email protected] Two annotations, the return JSON data does not need to be preceded by the method @responsebody annotations, but using @restcontroller this annotation, Cannot return jsp,htm
=requestmethod.get) PublicModelandview Doview () {Modelandview mv=NewModelandview ("Index"); returnMV; }}3. Start with the application [main] method4. Access the URL, access to the JSP pageHttp://localhost:8080/initpageAlso encountered a problem:
Spring boot returns the JSP file download directly.
Reason:The JSP file is not parsed, just add the following configuration in the Pom.xml file. OK,
Spring Boot official provides a clear and understandable example of landing authentication,In this example, we will demonstrate how spring boot can be certified for login.First we go to https://start.spring.io/download a sample project Spring-test.Our example contains three
I have no words, the DAO interface to re-modify, run again.
DAO interface
PackageSite.wangxin520.springboot.dao;ImportOrg.apache.ibatis.annotations.Delete;ImportOrg.apache.ibatis.annotations.Mapper;Importorg.apache.ibatis.annotations.Select; @Mapper Public InterfaceIndexmapper {//@Select ("Select username from ' user ' WHERE id=#{id};")@Select ("Select username from user where username like #{id};") Publicstring GetName (string id); //@Select ("DELETE from ' user ' where ID =
Spring boot uses Tomcat as the embedded Web container by defaultThere are three ways to customize1.2. The following@Component Public classCustomizationbeanImplementsembeddedservletcontainercustomizer{/*** Customizing Method One: Realizing Embeddedservletcontainercustomizer *@paramContainer*/@Override Public voidCustomize (Configurableembeddedservletcontainer cont
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.