aspose file tools*
The moose likes JSP and the fly likes Calling Custom tag Dynamically Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Java » JSP
Bookmark "Calling Custom tag Dynamically" Watch "Calling Custom tag Dynamically" New topic
Author

Calling Custom tag Dynamically

Shashi Prakash
Ranch Hand

Joined: Mar 28, 2007
Posts: 40
Hi,
I have many Custom tags in my application.. I wanted to use diffent tags based on some condition..

e.g..
Suppose I have myRadio and mySelect custom tag.. and I want to call these based on some condition..

<myTagsome variable) />

Here (Some variable) should be replaced by myRadio or mySelect based on given condition..

How can I implement this..

Please help me with this..


Thanks,<br />Target Scwcd<br />SCJP 1.4
Michael Ku
Ranch Hand

Joined: Apr 20, 2002
Posts: 510
you cannot do it the way you ask, but you can surround your tag with a <c:if> tag from JSTL
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61420
    
  67

Or define the tags in the first place to be able to detect when they should manifest themselves in different ways.


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
Shashi Prakash
Ranch Hand

Joined: Mar 28, 2007
Posts: 40
you cannot do it the way you ask, but you can surround your tag with a <c:if> tag from JSTL
----------------------------

Yes I can do this but the problem is that I have so many dynamic attributes .. and I don't want to have repetitive code ...
Michael Ku
Ranch Hand

Joined: Apr 20, 2002
Posts: 510
then Bear has the workable solution
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Calling Custom tag Dynamically