Are there any differences between getting session through HttpServletRequest.getSession()
and HttpSession
injected in controller's method?
相关问题
- Delete Messages from a Topic in Apache Kafka
- Jackson Deserialization not calling deserialize on
- How to maintain order of key-value in DataFrame sa
- StackExchange API - Deserialize Date in JSON Respo
- Difference between Types.INTEGER and Types.NULL in
Basically there is no diffrerence between the
session
object injected into a Spring MVC controller:And the
session
object retrieved from theHttpServletRequest
:The former style just provide you with a facility to get the contextual
HttpSession
object by injecting it as a controller argument so that Spring takes care of the all the dirty stuff for you.