Quantcast
Channel: Active questions tagged servlets - Stack Overflow
Viewing all articles
Browse latest Browse all 779

Why SessionAware injects SessionMap instead of HttpSession in Struts 2?

$
0
0

I have been working with Struts 2 for a long time.

In case of implementing SessionAware interface to our action class, we will get SessionMap, but not HttpSession object.

In case of ServletRequestAware and ServletResposeAware we get HttpServletRequest and HttpServletResponse object but not wrapper objects like SessionMap in case of SessionAware.

My question is, if Struts is giving us SessionMap instead of HttpSession to decouple our action classes from Servlet API and HTTP protocol,then why it is giving us HttpServletRequest and HttpServletResponse objects in case ServletRequestAware and ServletResponseAware?

If Struts doesn't want to decouple Servlet API and HTTP protocol from the action classes, then why it is giving us SessionMap in case of SessionAware interface.

Why we don't get HttpSession object?


Viewing all articles
Browse latest Browse all 779

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>