Spring MVC - do not create session for request -


is possible tell spring mvc not create session request?

we have application running in spring mvc, have many controller methods these: /add_client /show_order ... etc

it obvious need session these methods, have 1 special request:

@requestmapping(value = "/monitoring", method = requestmethod.get) public string monitoring(httpservletrequest request) {     // check     return "monitoring"; } 

for monitoring requests don't want create session.

if googling or searching here, found was: "i want session isn't created or doesn't work properly" want fix this: "i have session don't want (for request)"

is there option in spring mvc achieve this?

ladislav

create hidden variable in .jsp file request don't want keep session. in controller method check

public string yourmethod(httpservletrequest request, httpservletresponse response,             model, bindingresult bindingresult, modelmap modelmap) {             if( model.ishiddenpath() ){ // dont want keep session              request.getsession(false); } else{ request.getsession(true); 

it hard check yours methods in controller.it better use interceptor .


Comments

Popular posts from this blog

Why does Ruby on Rails generate add a blank line to the end of a file? -

keyboard - Smiles and long press feature in Android -

node.js - Bad Request - node js ajax post -