aspose file tools
The moose likes JSP and the fly likes Custom Tag Library Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


Win a copy of The Mikado Method this week in the Agile and other Processes forum!
JavaRanch » Java Forums » Java » JSP
Reply Bookmark "Custom Tag Library" Watch "Custom Tag Library" New topic
Author

Custom Tag Library

Bhavik Patel
Ranch Hand

Joined: Jul 12, 2004
Posts: 155
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???


SCJP 1.4<br />SCWCD 1.4(91%)<br />Working on SCJD -Bodgitt & Scrapper Constructions...<br /> <br />"It takes 43 muscles to frown & 17 to smile but it doen't take any to just sit there with a dumb look on your face .. Keep Smiling "
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 56204
    
  13

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 ]

[Smart Questions] [JSP FAQ] [Books by Bear] [Bear's FrontMan] [About Bear]
Derek Clarkson
Greenhorn

Joined: Mar 04, 2004
Posts: 25
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
 
I agree. Here's the link: http://ej-technologies/jprofiler - if it wasn't for jprofiler, we would need to run our stuff on 16 servers instead of 3.
 
subject: Custom Tag Library
 
Similar Threads
How to create object and call a method in jsp using struts 2 tags
release() in custom tag !!
Tag Library!!!
passing param from request to xsl stylesheet..
nested custom tags