Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / General / March 2007

Tip: Looking for answers? Try searching our database.

Custom tags - When does a parent tag know about its child tags?

Thread view: 
johkar - 11 Mar 2007 22:47 GMT
Bear with me because I am new at this.   Is there a way for the
beginning <layout:apppage> tag to know what all of its child tags are
before the child tags are invoked?  The leftnav and rightnav tags are
optional and I need to output HTML differently in the beginning
apppage tag based on what is present.

<layout:apppage>
 <layout:leftnav> <!-- code here --> </layout:leftnav>
 <layout:rightnav> <!-- code here --> </layout:rightnav>

<!-- my app code -->

</layout:apppage>

Also, both leftnav and rightnav have child tags of their own, I am
having trouble figuring out how to save all the HTML they generate and
output it with the ending apppage tag.

Thanks
Dan Andrews - 11 Mar 2007 23:50 GMT
> Bear with me because I am new at this.   Is there a way for the
> beginning <layout:apppage> tag to know what all of its child tags are
[quoted text clipped - 15 lines]
>
> Thanks

Have a look at the article that Jeff Wilson wrote titled "Take control
of your JSP pages with custom tags." There is also a good code sample
there that you can download. Here is the link:
http://www-128.ibm.com/developerworks/java/library/j-taglib/

Cheers,

Dan Andrews
-------------------
http://www.ansir.ca
johkar - 13 Mar 2007 01:05 GMT
> Have a look at the article that Jeff Wilson wrote titled "Take control
> of your JSP pages with custom tags." There is also a good code sample
[quoted text clipped - 3 lines]
>
> Dan Andrews

Thank you, very helpful.
Tom Hawtin - 12 Mar 2007 00:11 GMT
> Bear with me because I am new at this.   Is there a way for the
> beginning <layout:apppage> tag to know what all of its child tags are
> before the child tags are invoked?  The leftnav and rightnav tags are
> optional and I need to output HTML differently in the beginning
> apppage tag based on what is present.

The simple answer is no.

The possibly more useful answer is that you can evaluate the body, but
defer from passing on the output. If you buffer the output. then you can
change the header depending upon how the execution went within the body.

I've not done this sort of thing for five or six years, so can't
remember the details of the APIs. Example code is left as an exercise
for the reader.

Tom Hawtin
johkar - 13 Mar 2007 01:06 GMT
> johkarwrote:
> > Bear with me because I am new at this.   Is there a way for the
[quoted text clipped - 14 lines]
>
> Tom Hawtin

Thank you.


Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.