Converting an arraylist to a normal array
I was wondering if a开发者_Go百科nyone would be able to show me how to convert an arraylist to normal array in Jsp?
yourArrayList.toArray()
but this won't be generic.. to use the generic version, let's assume you've got an ArrayList<Yourclass>
. Just do:
YourClass[] array = yourArrayList.toArray(new YourClass[0]);
A side note: JSP is not a language but a container of Java code and html so what you need is Java code..
精彩评论