I am attempting to translate the functionality of a C# API, and I have arrived at some code that I cannot find a confident solution for.
It concerns storing data in the correct web-contexted scope. For now I could have fixed the issue simply by making a HashMap, but as I do not know the extended need for the data stored at this point, I want to go the length in trying to do it right. In my attempt to find a java solution that does the same, I have come across a scope I didn't know about before, namely the Flash-scope. It seems like it is the same as HttpContext.Current.Items, but I would definitely appreciate a second opinion on this. The flashScope is something i have discovered in the playframework.
Also, HttpContext.Current.Items seems to be accessed in a static way, while java usually makes object instances of a scope class, like HttpSession.
Can I store objects in scoped dictionaries staticly, like in the C#-code below?
Is the Flash scope equivalent to HttpContext.Current.Items
?
Can I access the Flash Scope without the Play Framework?
As always, I also very much would appreciate to know if I have made any wrong assumptions, or other misunderstandings.
Thank you :)
C# method
public void setItem(String itemName, Object item) {
HttpContext.Current.Items.set(itemName, item);
}