In a ServletContextListener
, I set an attribute like this:
ArrayList<String> prefs = new ArrayList<String>();
...
...
sc.setAttribute("user-preferences", prefs);
I try to use the attribute in a JSP page like this:
ArrayList<String> prefs = (ArrayList<String>) config.getServletContext().getAttribute("user-preferences");
I get the following warning:
Type safety: Unchecked cast from Object to ArrayList
Can someone please tell me why I get this warning?
Thanks.