File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Struts and the fly likes get Collection from request scope ??? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "get Collection from request scope ???" Watch "get Collection from request scope ???" New topic
Author

get Collection from request scope ???

Deependra Tewari
Greenhorn

Joined: Apr 12, 2006
Posts: 13
Hi there,
I'm trying to get an ArrayList back on a jsp page that i had previously added to the request object using request.setAttribute("name",listObject);

I had added it in the execute method of Action class that will forward to this jsp page where i want to get back this ArrayList and show its details !!!

However the page comes out to be blank. not even the table headings are visible !!! the struts-config.xml,web.xml, and context.xml are all ok !!!

Thanks
Merrill Higginson
Ranch Hand

Joined: Feb 15, 2005
Posts: 4864
In order to help you find the problem, we'll need you to post:

1-The portion of your Action class that sets the value in the request
2-The portion of your JSP that tries to retrieve and display the value from the request.
3-Any entries in your struts-config.xml file that are relevant to this process.


Merrill
Consultant, Sima Solutions
Deependra Tewari
Greenhorn

Joined: Apr 12, 2006
Posts: 13
Here's the action class
-----------------------------------------------------------------------------

-----------------------------------------------------------------------------
Here's the jsp that displays the ArrayList
-----------------------------------------------------------------------------

-----------------------------------------------------------------------------
struts-config.xml entry relevant to this page
-----------------------------------------------------------------------------

-----------------------------------------------------------------------------
Thanks

Added [ c o d e ] [ / c o d e ] tags to make this readable - Merrill
[ July 31, 2006: Message edited by: Merrill Higginson ]
Purushoth Thambu
Ranch Hand

Joined: May 24, 2003
Posts: 425
If you receive a blank page in struts it's because of forward issue. Your action class contains

return mapping.findForward("showList"); //forwards ok to the display page !!!


and the forward is configured as

<forward name="showlist" path="/showList.jsp" />
Deependra Tewari
Greenhorn

Joined: Apr 12, 2006
Posts: 13
thanks its working now.

sorry for not being alert .....
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: get Collection from request scope ???
 
Similar Threads
losing arraylist from request when form submits
Passing data from servlet to JSP to servlet
Reading an ArrayList from JSP to Servlet
array list into jsp page
Collection on jsp