This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes JSP and the fly likes Problem passing an arrayList from a servlet to a jsp Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » JSP
Bookmark "Problem passing an arrayList from a servlet to a jsp" Watch "Problem passing an arrayList from a servlet to a jsp" New topic
Author

Problem passing an arrayList from a servlet to a jsp

Raymond Champion
Greenhorn

Joined: Jan 21, 2009
Posts: 13
Hello,

I am having trouble getting an ArrayList I created in my servlet to get passed to my JSP.

I think I have correctly put the resultset into my bean called SubmissionEvents.

From here I am trying to pass this arraylist to my JSP(homepage.jsp). My app hangs when I run it, after I login into app.

If I remove the <jsp:useBean > tags from the JSP page I am trying to display then the JSP page will display.

If you have any insight into what I am doing wrong and can help me?

Servlet code



The JSP (homepage.jsp)



My bean SubmissionEvents.java

Christophe Verré
Sheriff

Joined: Nov 24, 2005
Posts: 14687
    
  16

1. Your useBean tag uses the session scope.
2. Your useBean tag expects a SubmissionEvents
3. "seResult" lives in the request scope
4. "seResult" is a List

That doesn't fit. You don't need to use useBean here. Using the EL expression ${seResult} should return you the list, which you can iterate through.


[My Blog]
All roads lead to JavaRanch
 
 
subject: Problem passing an arrayList from a servlet to a jsp
 
Similar Threads
web service integration using Netbeans IDE
org.apache.jasper.JasperException: java.lang.ArrayIndexOutOfBoundsException: 8
not able to insert values in ms access database
HTTP method GET is not supported by this URL
sending email in servlet