By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
454,646 Members | 1,336 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 454,646 IT Pros & Developers. It's quick & easy.

Receiving an ArrayList parameter from a method

sunsolaris2000
P: 20
Hi!

I need to insert in a html table (in JSP file) all the students in the same year. I tried 2 methods by now:

(1) In a java file I have a method(getStudents()) that searches in an ArrayList and find all students that are in the same year. This method returns the "results "ArrayList.

I need this ArrayList in JSP file. I tried to create a new ArrayList in JSP, called "found_students", but I don't know how to insert in it the students I receive from getStudents(). This list I need to insert in a html table.

(2) In java file, method getStudent() returns a Student object. In JSP I store the student in "search", which is of type Student. I used a do{}while(); but it found only the first occurence, not all the students in the list.

I'm new to JSP and I need this for school project. Any ideas/links? I searched Google, but I really didn't know how to search for "store the ArrayList received by calling a method in JSP in an ArrayList from java file".

Thank you in advance;)
Jul 1 '12 #1
Share this Question
Share on Google+
1 Reply


sunsolaris2000
P: 20
I solved it. The problem was the way I tested if array lists are containing elements and are not empty. I didn't say "!= false", but "!=0". But that's the way I found on web :p
Jul 14 '12 #2

Post your reply

Sign in to post your reply or Sign up for a free account.