Skip to content

Obero/demo-spring-request-scoped-bean

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Demo for Spring Request Scoped bean

Demonstration of a Spring Boot project using a context object whose lifecycle is bound to the request.

The javax.inject API is used to avoid passing the context object by parameter to each and every service layer. This API is already used by Spring to implement its dependency injection mechanism, but it is not directly accessible. That's why we add it explicitly in the project dependencies.

Inspired by Spring MVC - Request Scoped Bean post on LogicBig.com

Project based on Spring Initializr

Installation

Use Maven to generate the application. Not very useful, but use it if you wish !

mvn clean install

Usage

Exposed REST API :

Verb Route Parameter Response
GET /poneys/{cute} "true" OR "false" Poney object
GET /poneys/cute Poney object
GET /poney/lame Poney object

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages