• 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
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Custom Tag Library

 
Ranch Hand
Posts: 155
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I have a custom tag that display an image which is coming from database.
Tag has getter /setter method in its implementation .. setVisible,getVisible...I want to call getVisible() method on the JSP Page.
something like this <my isplayTag getVisible()/> ...How to achieve this thing???
 
Sheriff
Posts: 67746
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
That makes no sense. Custom tags are not beans that have properies you can access in that fashion.

What you can do is to have the tag emit scoped variables with "results" that you can utilize in EL references later on the page.
[ July 29, 2005: Message edited by: Bear Bibeault ]
 
Greenhorn
Posts: 25
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Sounds to me like you are confusing beans with tags. A bean is an object with a specific state. Therefore throughout your html you can get/set it's properties. Tags on the other hand are about processing data and are often used to produce beans which you can then access. Depending on what you are trying to access you might approach things in a number of ways. For example, you might get your tag to create a bean in page scope which <c:if> tags can then interrogate to decide if things should be visible. Or you might construct a tag which optionally includes it's body if the visible flag is set.

There are lots of subtle variations on the above and also ways of mixing tags and beans more closely, but you need to have a clear pciture of what you are trying to achieve first.

ciao
Derek
 
reply
    Bookmark Topic Watch Topic
  • New Topic