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 "
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.