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 Pass collection object from tag class to jsp Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » JSP
Bookmark "Pass collection object from tag class to jsp" Watch "Pass collection object from tag class to jsp" New topic
Author

Pass collection object from tag class to jsp

vivek dhiman
Ranch Hand

Joined: Aug 05, 2011
Posts: 111

Hi

I am not able to get the arraylist object on jsp. Below is my code.


JSP File


Nothing gets print on jsp

Thanks
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 60780
    
  65

At what point do you create articleList as a scoped variable? I assume the tag is called before the JSP fragment you posted? (This is the sort of thing you should mention in the post.)

The page can't magically see into your tag to local variables.


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
vivek dhiman
Ranch Hand

Joined: Aug 05, 2011
Posts: 111

Hi Below is my JSP code that i am using now. Please make me right where i am wrong.

Paul Clapham
Bartender

Joined: Oct 14, 2005
Posts: 18541
    
    8



I'm a bit confused by this. To me it says "Declare a request-scoped variable named articleList, and give it the value which comes from the scoped variable named articleList". What did you intend this code to do?
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 60780
    
  65

Exactly, your added JSP code does nothing.

Where in the tag do you create the scoped variable?
vivek dhiman
Ranch Hand

Joined: Aug 05, 2011
Posts: 111

So shall i need to place inside<m:DisplayArticle>tag like:

Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 60780
    
  65

You need to do it from the Java code. How else is anything else to access the local variable?
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Pass collection object from tag class to jsp
 
Similar Threads
Neither BindingResult nor plain target object for bean name 'vids2m1' available as request attribute
Accessing Object in a JSP using JSTL
Exception while binding an array. Missing []
ArrayList not loading on JSP
404 Error When Using Spring + Hibernate in My Project.