Possible duplicate:
How to convert an array of objects to a string array in Java
I get the object and translate it into a String array as follows:
Object values[] = (Object[])request.getSession().getAttribute("userList");
String[] tmp = new String[values.length];
for(int i = 0; i < tmp.length; ++i) {
tmp[i] = (String) values[i];
out.println(tmp[i]);
}
Is there a better and cleaner way to do this?
source
share