• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Tim Cooke
  • Devaka Cooray
Sheriffs:
  • Liutauras Vilda
  • paul wheaton
  • Rob Spoor
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Piet Souris
  • Mikalai Zaikin
Bartenders:
  • Carey Brown
  • Roland Mueller

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

 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Ranch Hand
Posts: 132
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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...
 
Onion rings are vegetable donuts. Taste this tiny ad:
We need your help - Coderanch server fundraiser
https://coderanch.com/wiki/782867/Coderanch-server-fundraiser
reply
    Bookmark Topic Watch Topic
  • New Topic