Spring Web Flow and Session

By james

In looking over the SWF stuff a bit I noticed that it required session. Then I noticed that it didn’t create one if it didn’t already exist. My first reaction was that it should…I mean, you need one anyway right. Well I had decided I was ok with the approach (after thinking about problems when session is created when you don’t expect)…then Erwin posts a question to the dev list asking this very question. (you can follow the thread here, here, here, and here…not sure why it broke up so much).

Basically, it broke into a discussion of how to make SWF work without requiring session (not instead-of, but in-addition to). My take on it is that SWF could ‘do the right thing’ and use the session if it is there, otherwise serialize it to the request (via another hidden param in the form). They would have a custom tag that would spit out the right thing (either the info to pull from session, or the serialized data) and have the controller deserialize if it is on the request, otherwise pull from session.

We’ll see how it all goes, but it looks like SWF will soon support flows without session (for visitors, etc).

I still need to actually give it a closer look…maybe over the weekend.

Leave a Reply