File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes JSP and the fly likes Calling Custom tag Dynamically 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 "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: 56192
    
  13

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


[Smart Questions] [JSP FAQ] [Books by Bear] [Bear's FrontMan] [About 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://ej-technologies/jprofiler - if it wasn't for jprofiler, we would need to run our stuff on 16 servers instead of 3.
 
subject: Calling Custom tag Dynamically
 
Similar Threads
Include code in JSP
Too many drop down lists in my page
JSP 2.0 Custom Tags and Database
JSP Custom Tags
Display tags and Jsp Scriptlet