> I am looking for an example that SessionMap should be used instead of Map.
> In the Struts 2 Getting Started HTTP Session tutorial (
> HelloWorldAction.java used
> private Map<String, Object> userSession;
> I used SessionMap to replace Map.
> private SessionMap<String, Object> userSession;
> I got the same result after I compiled & executed the modified program, so
> this is not an example to show the difference between SessionMap and Map.
The short answer is: you should not use SessionMap and stick with Map
This an internal implementation that can change at any time and you
shouldn't depend on any concrete implementation but just use the
interface - this is safer.