The professional, friendly Java community. 21,500 members and growing!

The Java Programming Forums are a community of Java programmers from all around the World. Our members have a wide range of skills and they all have one thing in common: A passion to learn and code Java. We invite beginner Java programmers right through to Java professionals to post here and share your knowledge. Become a part of the community, help others, expand your knowledge of Java and enjoy talking with like minded people. Registration is quick and best of all free. We look forward to meeting you.

How to pass the ArrayList form servelet to jsp?

Hi,

I m new in Servlet side programming.i want to pass the ArrayList from Servlet to JSP page.how do i do this? below is what i tried.it allways pass Null value.My java file name is Login.java and my jsp file name is FirstJSP.jsp.

Re: How to pass the ArrayList form servelet to jsp?

There's a difference between request attributes and session attributes. Notice when you save your variable you are doing request.setAttribute() but when you get it back you call request.getSession().getAttribute(). You need to pick one or the other. The request object only lasts for this request while the session continues to exists as the user navigates through the website.

Writing code is your job, helping you fix and understand it is mine.

<-- Be sure to thank and REP (Star icon) those who have helped you. They appreciate it!