- What is the compiler complaining about ?

BTW: It's not legal to cast a String[] to an ArrayList.
This should at least produce a runtime error.

You have to explicitly convert the String[] to an ArrayList.
ArrayList importList = new ArrayList(Arrays.asList(request.getAttribute("importList"));

> -----Original Message-----
> From: McClure, Timothy J(IndSys, GE Interlogix)
> [mailto:[EMAIL PROTECTED]
> Sent: Tuesday, September 16, 2003 7:14 PM
> To: [EMAIL PROTECTED]; McClure, Timothy J(IndSys, GE
> Interlogix)
> Subject: JSP that doesn't work with IBM JVM 1.4
> 
> ArrayList importList = 
> (ArrayList)request.getAttribute("importList"); // returns String[]
> String[] sortArray = new String[importList.size()]; // array 
> for sorting input data
> sortArray = (String []) importList.toArray(sortArray);
> 
> It seems the above code works fine under Tomcat when using 
> the Sun JVM 1.4 but refuses to compile using the IBM JVM 1.4. 

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to