GoConqr hat ein neues Design! Sag uns, wie es dir gefällt.

Mindmap

Spring configuration

Felipe Malfatti Portugiesisch

Inhalt der Mindmap

Spring configuration

  1. To obtain Environment variables

    • You can Inject Environment with @Autowired
      • and call environment.getProperty("PROP_NAME")
    • You can use @Value annotation
      • can be use in fields or methos parameters
      • @Value("${environmentName}")
  2. @Profile

    • Method
    • Class
    • Multiples profiles can be active
    • is equivalent to profile attribute on <beans> tag, <beans> tags can be nested
      • Profile attribute not work on tag <bean>
  3. @Configuration

    • Defines a configuration class
    • Are subclassed at startup-time with CGLIB
      • Configuration class should not be final
    • You can use @Import
      • To split @Configurations in multiples class
    • @PropertySource
      • Additional property sources
      • @Configuration @PropertySource("classpath:/com/exampleconfig/application.properties") public class ApplicationConfiguration {
    • Can be mixed with @ComponentScan
      • But component scanning can work without @Configuration
        • <context:component-scan base-package="br.com.softplan">
  4. Spring Expression language (SPEL)

    • can be used in @Value annotation values
    • ${} is for properties
    • #{} is for SpEL
    • Access property of bean #{beanName.property}
    • systemProperties
    • systemEnvironment
    • Used in spring Security and batch
  5. @EnableAutoConfguration

    • Springboot automatically attempts to configure yout application based on the jar dependencies that you have added
      • You should only ever add one @SpringBootApplication or @EnableAutoConfiguration annotation.
        • in your main class with @Configuration

Informationen

Beschreibung
Mindmap am Spring configuration, erstellt von Felipe Malfatti am 16/04/2018.
Erstellt von
Felipe Malfatti
Aufrufe
0
Bewertung

Feedback

Worum geht es?

Wie gefällt dir das neue Design?

Dein Eindruck