This week's book giveaway is in the Java in General forum.
We're giving away four copies of Think Java: How to Think Like a Computer Scientist and have Allen B. Downey & Chris Mayfield on-line!
See this thread for details.
Win a copy of Think Java: How to Think Like a Computer Scientist this week in the Java in General forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

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

 
Xuefei He
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Brusk Baran
Ranch Hand
Posts: 132
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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...
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic