wood burning stoves 2.0*
The moose likes JSP and the fly likes How do u pass an object to a taglib from 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 "How do u pass an object to a taglib from a jsp?" Watch "How do u pass an object to a taglib from a jsp?" New topic
Author

How do u pass an object to a taglib from a jsp?

Xuefei He
Greenhorn

Joined: Oct 22, 2003
Posts: 1
i'm working on a project that requires using the STRUTS technology.
at first, i didn't use the taglib for cleaner look of the codes.
then i use the taglib to iterate the data and i realized that i didn't know how to get the List object(which is the one passed from the STRUTS ACTION) from jsp.
i learned how to set attributes into jsp by using TagExtraInfo Class, how do i get an attribute ( the List ) from the jsp?
-------------------------------
currently i just "new" the database managing class again in the taglib class to get the List, so that makes the List in STRUTS ACTION useless.


be nice
Brusk Baran
Ranch Hand

Joined: Nov 15, 2001
Posts: 132
just put that object in the pageContext, PAGE Scope; in your jsp page.
then get it inside the Tag Handler Class via the implicitly given pageContext, by the Adapter class...
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: How do u pass an object to a taglib from a jsp?
 
Similar Threads
JSTL version causing exceptions?
servlet action is not available
Summary of Struts, by Struts newbie
display image on sturts from data base
java.lang.NullPointerException in a simple servlet