JSP Page HttpServletRequest getAttribute Typecasting
- by MontyBongo
Hi There,
Any ideas on the correct method of typecasting an Object out of a getAttribute request from a JSP page HttpServletRequest?
I have googled but it seems that the common solution is just sticking suppresswarnings in your code... Something I would very much like to avoid.
I currently have:
HashMap<String, ArrayList<HashMap<String, String>>> accounts = (HashMap<String, ArrayList<HashMap<String, String>>>)request.getAttribute("accounts");
And the complier is giving me this warning:
Unchecked cast from Object to HashMap
Thanks in Advance!!
MB.