简体   繁体   中英

Spring stateless Rest web service

I have Spring 3 based web application. I have used @ResponseBody over controller for exposing some rest service to be used by web pages using ajax call.

I want to expose some stateless REST services for customer eg search, add. I have bypassed those urls and applied security on it.

It is using Dispatcher servlet which is being used by my web application. And it has session timeout of 60 minutes . I think it will create a session for every REST call using existing configuration.

Question: How to avoid these sessions?

Thank you

As long as there is nothing in your application forcing session creation, ie calls to request.getSession or the use of session scoped beans in controllers used by the REST calls, no sessions will be created.

The session-timeout is only there to state that sessions that do get created are cleaned after ~60 minutes of inactivity.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM