Below you will find pages that utilize the taxonomy term “spring”
Posts
A tiny Springboot app
This miniblog is adpated from this linkedin course
The tweet that started it all Install springboot cli Easiest way is via sdkman.
sdk install springboot Groovy classFile:
ThisClassWillActuallyRun.groovy
@Controller class ThisWillActuallyRun { @RequestMapping("/") @ResponseBody String home() { "Hello World!" } } Running the app:
spring ThisWillActuallyRun Output:
. ____ _ __ _ _ /\\ / ___'_ __ _ _(_)_ __ __ _ \ \ \ \ ( ( )\___ | '_ | '_| | '_ \/ _` | \ \ \ \ \\/ ___)| |_)| | | | | || (_| | ) ) ) ) ' |____| .
read morePosts
Working with Spring Data and Json
1. Overview
Json is, in many places, the preferred way of storing data due to it’s brevity (mostly compared to xml) and human readability. While working in any web framework which involve operation with data models and templates, usage of json data format is almost inevitable. Languages like Python, Ruby even have this format conceptually built into the core language library itself. Hash in ruby and dictionaries in python which allow json-(dictionary/hash) conversion with an ease.
read morePosts
Autowiring Generics In Spring
@Autowired is heavily used in Spring for injecting dependencies. By entrusting the framework itself to inject dependencies (eg: repositories interface) programmer can rest assurred and focus on core business logic of the application.
We can also use @Autowired in order to initialize java collections which use Generics. Let’s say we have an interface which could be implemented by a given number of classes. We can Register each of those classes in Spring Context with @Context annotation.
read more