spring-session-example | small sample project used to demonstrate Spring | Application Framework library
kandi X-RAY | spring-session-example Summary
kandi X-RAY | spring-session-example Summary
This is a small sample project used to demonstrate Spring Session. It consists of an Embedded Tomcat that has a single HelloServlet servlet. When issuing a GET request, the servlet will respond with either the default Hello World! or if the name session attribute has been set with Hello [name]. The name session attribute can be changed by issuing a POST request with a name parameter. For more information, please read my blog post Scaling out with Spring Session.
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
- Entry point to Tomcat
- Gets the greeting
- Handles POST request
spring-session-example Key Features
spring-session-example Examples and Code Snippets
Community Discussions
Trending Discussions on spring-session-example
QUESTION
I am trying to create a simple Spring Boot Session project. It's the basic setup from Spring Initializr. I am getting following errors:
...ANSWER
Answered 2018-Jun-21 at 08:58You are missing the spring-session-jdbc
dependency so the JdbcOperationsSessionRepository
isn't present on the classpath. Your dependency management provides only spring-session-core
dependency, which provides only Spring Session core API - the concrete SessionRepository
implementations are placed in dedicated modules i.e. spring-session-data-redis
, spring-session-jdbc
, spring-session-hazelcast
etc.
Once you do that, you can also remove the spring.session.store-type
configuration property. As long as you have a single SessionRepository
implementation on the classpath, Spring Boot will be able to deduce which one to auto-configure without you having to provide spring.session.store-type
.
Having said that, Initializr should be able to include spring-session-jdbc
for you however I believe you originally only selected Web
, Session
and MySQL
options when creating project on Initialzr. Together with Session
option, you should also select the store you intend to use (like JDBC
in this case) so the Initializr can include the required Spring Session module.
On a final note, the arrangement with Spring Session modules changed in Spring Session 2.0, as previously all the code and SessionRepository
implementations were placed in spring-session
artifact which doesn't exist anymore in Spring Session 2.0. You can learn more about this in in the reference manual and have been mentioned in the 2.0.0.RELEASE
announcement.
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install spring-session-example
You can use spring-session-example like any standard Java library. Please include the the jar files in your classpath. You can also use any IDE and you can run and debug the spring-session-example component as you would do with any other Java program. Best practice is to use a build tool that supports dependency management such as Maven or Gradle. For Maven installation, please refer maven.apache.org. For Gradle installation, please refer gradle.org .
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page