https://github.com/stormpath/stormpath-spring-boot-dependency-injection-example
https://github.com/stormpath/stormpath-spring-boot-dependency-injection-example
Last synced: 3 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/stormpath/stormpath-spring-boot-dependency-injection-example
- Owner: stormpath
- Created: 2016-07-27T22:03:25.000Z (almost 10 years ago)
- Default Branch: master
- Last Pushed: 2017-03-07T00:00:20.000Z (about 9 years ago)
- Last Synced: 2025-10-24T21:48:25.276Z (7 months ago)
- Language: Java
- Size: 9.77 KB
- Stars: 2
- Watchers: 6
- Forks: 3
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
#Stormpath is Joining Okta
We are incredibly excited to announce that [Stormpath is joining forces with Okta](https://stormpath.com/blog/stormpaths-new-path?utm_source=github&utm_medium=readme&utm-campaign=okta-announcement). Please visit [the Migration FAQs](https://stormpath.com/oktaplusstormpath?utm_source=github&utm_medium=readme&utm-campaign=okta-announcement) for a detailed look at what this means for Stormpath users.
We're available to answer all questions at [support@stormpath.com](mailto:support@stormpath.com).
This example demonstrates Spring's Dependency Injection features in a Spring Boot application.
All of the code is explained in the blog post found [here](http://stormpath.com/blog).
### Build
```
mvn clean install
```
### Run
```
[LANGUAGE_NAME=english|french] \
[LIFE_INT=] \
[LIFE_STRING=] \
java -jar target/*.jar
```
All parameters are optional and are used to demonstrate different modes of operation explained in the blog post.
### Interact
The examples below use [HTTPie](https://github.com/jkbrzt/httpie)
1. `http localhost:8080`
returns a greeting from the configured `greetinService` - English by default
2. `http localhost:8080/meaningOfLife`
returns the value from the `MeaningOfLife` component injected in the constructor - 0 by default
3. `http localhost:8080/name?type=[dog|person]`
returns the name found in the appropriate `Nameable` component injected using setters in `NameHelper`
4. `http localhost:8080/allNames`
returns all the names from all the `Nameables` loaded by Spring
5. `http localhost:8080/beans[?q=]`
returns all the bean names loaded by Spring. Takes an optional `q` query param to narrow the search to beans whose names contain the search term (case insensitive)