top of page

Spring Annotation

  • Writer: Anand Nerurkar
    Anand Nerurkar
  • Apr 30, 2024
  • 1 min read

Updated: Jun 20, 2024

@SpringBootApplication

  • @EnableAutoConfiguration

  • @Configuration

  • @ComponenetScan


ree

@configuration,

@Bean

This is being used for java based configuration and if you so not want spring ioc to manage life cycle , then make use of this.

ree


ree

By default, spring beans are eagerly loaded, so load it lazily, we make use of @Lazy


@ConfigurationProperties

ree
ree

@Value will retrieve data from application.propeties file. but if we want to retrieve it from other custom properties file, then we have to use @propertySource along with @Value


ree

@pathvariable /v1/{id}


path variable is mandatory part of request in case id is missing 404 is issued-resource not found


@RequestPAram /v1/idbyparam?id=1 , id is optional ,so still your endpoint will work



ree

ree

 
 
 

Recent Posts

See All

Comments

Rated 0 out of 5 stars.
No ratings yet

Add a rating
  • Facebook
  • Twitter
  • LinkedIn

©2024 by AeeroTech. Proudly created with Wix.com

bottom of page