Problem with getting generics working in JSP

In my Servlet I have some generics in my code

ArrayList<MyObject> list = (ArrayList<MyObject>) obj.getSomeObject();

request.getSession.setAttribute("list", list);

But when I try the following in a JSP

Object obj = request.getSession.getAttribute("list");

ArrayList<MyObject> list = (ArrayList<MyObject>) obj;

I get the following warning in Eclipse: "Type safety: The Cast from Object to ArrayList<MyObject> is actually checking against the erased type ArrayList"

This is just a warning, but my webapplication runs with an exception on the JSP page. If I remove the generics from the JSP it works fine. Can I use generics in JSP?

[708 byte] By [DJ_Vikinga] at [2007-11-27 7:40:26]
# 1
that depends on if the JSP compiler is set to use the java 1.5 (or higher) compiler. So basically it depends on what webserver you are using. Which one is it and what version?
gimbal2a at 2007-7-12 19:20:57 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 2

The "Compiler compliance level" is set to 5.0

I am using WebSphere v6.1 to deploy my web application.

I have no problem to create a generic ArrayList in JSP. The problem occurs when I try to cast a object which I know and have checked is a generic ArrayList.

First I check if the object is an instance of ArrayList. Then I check if the content of that ArrayList is an instance of my generic object. So I have taken every step to assure that it is what it is supposed to be.

DJ_Vikinga at 2007-7-12 19:20:57 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...