SpringBoot: Difference between revisions
| Line 1: | Line 1: | ||
==Introduction== | ==Introduction== | ||
* Framework to build microservices | * Framework to build microservices | ||
* common non-functional features | |||
==Concepts== | ==Concepts== | ||
* SpringBoot Autoconfiguration | * SpringBoot Autoconfiguration | ||
Revision as of 15:38, 26 February 2021
Introduction
- Framework to build microservices
- common non-functional features
Concepts
- SpringBoot Autoconfiguration
- Dispatcher Servlet
Security
adding to pom.xml:
<dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-security</artifactId> </dependency>
and update the project automatically sets up form-based authentication with a generated session cookie generated on the server or basic authentication with a header sent along with every request
- user='user
- pwd=see console output of server start
or set it in application.properties
spring.security.user.name=uwe spring.security.user.password=uwe
This has to be entered just once.
Configuration
\test1\src\main\resources\applircation.properties logging.level.org.springframework = debug
Implementation
import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.RestController; @RestController @CrossOrigin(origins="http://localhost:4200") // avoid cross origin errors in browser public class HelloWorldController { // @RequestMapping(method=RequestMethod.GET, path="/hello-world") @GetMapping(path="/hello-world")