File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
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
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
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Problem passing an arrayList from a servlet to a jsp