One of the handiest features of Grails is the "flash" scope. The flash scope is "A temporary storage map that stores objects within the session for the next request and the next request only, automatically clearing out the objects held there after the next request completes." It's a handy way to send messages and errors around when dealing with form posts and redirects. Since I've been working with Spark Java I've found myself missing this little feature so I decided to throw together my own implementation. I've added the following closure inside of my
main() method in my
To manage the lifetime of the scope, I've added the following in my
after() filter. It limits the lifetime of any flash scoped variable to 2 requests:
To read from the scope:
To write to it:
flash(request, 'key', 'value')
For convenience the write method also returns the value meaning you can do things like this:
To return then entire flash scope:
I have blogged quite a bit about serverless Oracle Functions here on this blog, including several various examples about function invocation. But, I've...
A few weeks ago, I blogged about a utility that I created that helps you debug your serverless functions in the Oracle Cloud. The code behind that project...
Working with serverless functions represents a new way of thinking for many developers. Dealing with stateless functions, for example, can be a challenge...