Custom taglib with nested tag not working

Hi everybody,
I have a question concerning a custom taglib. I want to create a tag with nested child tags. The parent tag is some kind of iterator, the child elements shall do something with each iterated object. The parent tag extends BodyTagSupport, i have overriden the methods doInitBody and doAfterBody. doInitBody initializes the iterator and puts the first object in the pageContext to be used by the child tag. doAfterBody gets the next iterator object and puts that in the pageContext, if possible. It returns with BodyTag.EVAL_BODY_AGAIN when another object is available, otherwise BodyTag.SKIP_BODY.
The child tag extends SimpleTagSupport and does something with the given object, if it's there.
In the tld-file I have configured both tags with name, class and body-content (tagdependent for the parent, empty for the child).
The parent tag is being executed as I expected. But unfortunately the nested child tag does not get executed. If I define that one outside of its parent, it works fine (without object, of course).
Can somebody tell me what I might have missed? Do I have to do something special with a nested tag inside a custom tag?
Any help is greatly appreciated!
Thanks a lot in advance!
Greetings,
Peter

Hi again,
unfortunately this didn't work.
I prepared a simple example to show what isn't working. Perhaps it's easier then to show what my problem is:
I have the following two tag classes:
public class TestIterator extends BodyTagSupport {
    private Iterator testIteratorChild;
    @Override
    public void doInitBody() throws JspException {
        super.doInitBody();
        System.out.println("TestIterator: doInitBody");
        List list = Arrays.asList(new String[] { "one", "two", "three" });
        testIteratorChild = list.iterator();
    @Override
    public int doAfterBody() throws JspException {
        int result = BodyTag.SKIP_BODY;
        System.out.println("TestIterator: doAfterBody");
        if (testIteratorChild.hasNext()) {
            pageContext.setAttribute("child", testIteratorChild.next());
            result = BodyTag.EVAL_BODY_AGAIN;
        return result;
public class TestIteratorChild extends SimpleTagSupport {
    @Override
    public void doTag() throws JspException, IOException {
        super.doTag();
        System.out.println(getJspContext().getAttribute("child"));
        System.out.println("TestIteratorChild: doTag");
}The Iterator is the parent tag, the Child shall be shown in each iteration. My taglib.tld looks like the following:
<?xml version="1.0" encoding="UTF-8"?>
<taglib
     xsi:schemaLocation="http://java.sun.com/xml/ns/javaee web-jsptaglibrary_2_1.xsd"
     xmlns="http://java.sun.com/xml/ns/javaee"
     xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" version="2.1">
     <tlib-version>1.0</tlib-version>
     <short-name>cms-taglib</short-name>
     <uri>http://www.pgoetz.de/taglibs/cms</uri>
     <tag>
          <name>test-iterator</name>
          <tag-class>de.pgoetz.cms.taglib.TestIterator</tag-class>
          <body-content>tagdependent</body-content>
     </tag>
     <tag>
          <name>test-iterator-child</name>
          <tag-class>de.pgoetz.cms.taglib.TestIteratorChild</tag-class>
          <body-content>empty</body-content>
     </tag>
</taglib>And the snippet of my jsp is as follows:
     <!-- TestIterator -->
     <cms:test-iterator>
          <cms:test-iterator-child />
     </cms:test-iterator>The result is that on my console I get the following output:
09:28:01,656 INFO [STDOUT] TestIterator: doInitBody
09:28:01,656 INFO [STDOUT] TestIterator: doAfterBody
09:28:01,656 INFO [STDOUT] TestIterator: doAfterBody
09:28:01,656 INFO [STDOUT] TestIterator: doAfterBody
09:28:01,656 INFO [STDOUT] TestIterator: doAfterBody
So the child is never executed.
It would be a great help if anybody could tell me what's going wrong here.
Thanks and greetings from germany!
Peter
Message was edited by:
Peter_Goetz

Similar Messages

  • Custom component with additional tags

    Hi. I need to write complicated custom JSF component.
    I know how to write simple custom components, and receive String variables from tag attributes e.g.
    https://github.com/devalentino/temp/blob/master/src/main/java/net/monopolyclub/components/component/UserData.java
    But now I need to write custom component with additional tags (for example like dataTable and column tags).
    How can I write such component? How can I receive collections in my component? How can I work with additional tags in my component.
    for example I need something like:
    <m:chat>
         <m:tab value="#{UserList}" />
         <m:message value="#{MesageMap}" />
    </m:chat>
    where UserList - Collection with current users and MessageMap is Map with User as key and message as value.

    Iam using pt:ptdata.joincurrcommunitydata
    here is some code
    <pt:ptdata.joincurrcommunitydata pt:id="menutabsjoin" />
    <pt:logic.foreach pt:var="temp2" pt:data="menutabsjoin">
    <span class="CommunityPage">
    <pt:core.html href="$temp2.url" pt:tag="a">
    <pt:core.html pt:tag="img" src="$temp2.img" alt="$temp2.title" border="0" align="absmiddle" height="$temp2.imgheight"      width="$temp2.imgwidth" />
                        <pt:logic.value pt:value="$temp2.title" />
                             </pt:core.html>
                             </span>
                             </pt:logic.foreach>
    But the URL that is generated is not having the CommunityID, hence it errors out saying object not found.
    Any help would be appreciated?
    Thanks
    kartik

  • Serial number provided with download does not work, now what?

    serial number provided with download does not work, now what?

    Chrish29593217 you are welcome to contact our directly at Contact Customer Care.  What Adobe software title are you facing difficulties with?

  • Customer JSF Component Value Expression not work

    why my customer tag not work,
    in my jsp
    <q:my formatString="yyyy/mm/dd" current="#{LoginBean.date}"></q:my>the isLiteralText() always return true, and I can't get the correct value, #{LoginBean.date} is returned.
    bellow is my tag source.
    can anyone help me.
    package jsf;
    import javax.el.ValueExpression;
    import javax.faces.component.UIComponent;
    import javax.faces.webapp.UIComponentELTag;
    public class MyCustomerTag extends UIComponentELTag {
        private String formatString;
        @Override
        public String getComponentType() {
            return "COMPONENT_TYPE";
        @Override
        public String getRendererType() {
            return "COMPONENT_TYPE";
        @Override
        public void release() {
            super.release();
            setFormatString(null);
        @Override
        protected void setProperties(UIComponent component)  {
            if (!(component instanceof UIDatePicker))
                throw new IllegalArgumentException("Component "+
                    component.getClass().getName() +" is no UIDatePicker");
            component.setValueExpression("current", current);
            System.out.println(current.getExpressionString());
            System.out.println(current.isLiteralText());
            System.out.println((String) component.getAttributes().get("current"));
         * @return the formatString
        public String getFormatString() {
            return formatString;
         * @param formatString the formatString to set
        public void setFormatString(String formatString) {
            this.formatString = formatString;
        private ValueExpression current;
         * @return the value
        public ValueExpression getCurrent() {
            return current;
         * @param value the value to set
        public void setCurrent(ValueExpression current) {
            this.current = current;
    }

    I do not know what your native is, but there's quite a huge difference between "custom" and "customer". Look it up in your dictionary.

  • ScriptLink tag not working for application page sharepoint 2010

    <ScriptLink> tag not working for application page sharepoint 2010 for including javascript in application page, it appends either 1033 or _layout to path specified for javascript.But javascripts are located in custom document library on site and not
    in _layouts folder.
    Please help and explain in details as I tried lot on this.

    Hi,
    Use the following line of code
    <SharePoint:Scriptlink runat="server" Name="~sitecollection/Style Library/[YOUR SITE]/js/functions.js" Language="javascript" />
    Thanks,
    Vivek
    Please vote or mark your question answered, if my reply helps you

  • Customized strings in iPad viewer not working?

    Hello,
    per request of client i've tried to change one string in viewer for iPad. So i've created template in DSP App Builder, modified this template on my computer, choose this file in App Builder and prepared another build (V28). Unfortunately, i still see old original string (i've double tested that i'm downloading new version of app). When i now check DPS App Builder, it just says "Asset stored on server", so i asume, that everything goes smoothly on this side.
    Any similar experience with customized strings?
    Thanks
    Martin

    Everything was done from scratch with V28.
    1. 10. 2013 v 16:14, Bob Bringhurst <[email protected]>:
    Re: Customized strings in iPad viewer not working?
    created by Bob Bringhurst in Digital Publishing Suite - View the full discussion
    That's odd. It worked for me when I tested it. Perhaps you should try moving the current xml file to a different folder, downloading a new version, copying and pasting, and rebuilding.
    Please note that the Adobe Forums do not accept email attachments. If you want to embed a screen image in your message please visit the thread in the forum to embed the image at http://forums.adobe.com/message/5728130#5728130
    Replies to this message go to everyone subscribed to this thread, not directly to the person who posted the message. To post a reply, either reply to this email or visit the message page: http://forums.adobe.com/message/5728130#5728130
    To unsubscribe from this thread, please visit the message page at http://forums.adobe.com/message/5728130#5728130. In the Actions box on the right, click the Stop Email Notifications link.
    Start a new discussion in Digital Publishing Suite at Adobe Community
    For more information about maintaining your forum email notifications please go to http://forums.adobe.com/message/2936746#2936746.

  • HT4235 iPod nano 6th generation, syncing with audiobooks does not work now, had been working.  Sync test says:  No iPod touch, iPhone, or iPad found.  Connectivity test OK, no physical problems, iTunes shows the iPod.  Any clues what to do?

    iPod nano 6th generation, syncing with audiobooks does not work now, had been working.  Sync test says:  No iPod touch, iPhone, or iPad found.  Connectivity test OK, no physical problems, iTunes shows the iPod.  Any clues what to do?

    Hmm.. Thank you for the response.
    Have you tried using the iPod with another user account or computer, to help narrow down whether the problem lies with the computer, account, or the iPod itself?
    Maybe try reformatting it, using the tools provided by Windows. Instructions on how to reformat your iPod can be found in this article.
    http://www.methodshop.com/gadgets/ipodsupport/erase/index.shtml
    B-rock

  • Brand new Mac user help please! How do you connect a 17" monitor to the MacBook? I have the monitor plugged into the Mac, but the F8 that I am used to with PC does not work. Please help. Thanks.

    Brand new Mac user help please! How do you connect a 17" monitor to the MacBook? I have the monitor plugged into the Mac, but the F8 that I am used to with PC does not work. Please help. I am getting lots of spelling errors as the MacBook laptop screen is too small. Thank you so much! .

    Contentmom6 wrote:
    Brand new Mac user help please! How do you connect a 17" monitor to the MacBook? I have the monitor plugged into the Mac, but the F8 that I am used to with PC does not work.
    Normally, you just connect the monitor to the MacBook using a VGA adaptor that you can buy from an Apple Store.  Now try System Preferences > Displays > Detect Displays.  You should now be able to select a display mode for the monitor.  If it still doesn't work, then I'd check that everything is properly connected.  I've had problems with colours disappearing due to a faulty connection in the VGA adaptor.
    Bob

  • FIND with MATCH OFFSET not working

    Hi,
    I have a statement:
    FIND '/' IN <ls_data_package>-/bic/zbib_sysn MATCH OFFSET off2.
    this works in all the case except for when <ls_data_package>-/bic/zbib_sysn = SSULTANA-VMC/.
    (i.e. when /bic/zbib_sysn = USERID-VMC/, here SSULTANA is the user ID)
    *In this case off2 = .
    Value of sy-subrc is 0 after this statement is executed
    Can some one please point out what I am doing wrong.
    Thank you,
    CD
    Edited by: CSD . on Sep 26, 2008 9:53 PM

    >FIND with MATCH OFFSET not working  
    Most unlikely.  More likely is that it isn't doing what you think it should be doing.  Or you're using it incorrectly!
    I can't really follow what your problem is.  I assume you mean that you are getting off2 with value 0, when /bic/zbib_sysn contains USERID-VMC/
    Can you be a little clearer in what the issue is?
    DATA: off2 TYPE i.
    FIND '/' IN 'this string /' MATCH OFFSET off2.
    WRITE: / sy-subrc, off2.
    This little program returns 0 and 12 
    matt

  • I am having trouble with my speakers not working while online in particular on windows.My audio works when playing audio files

    I am having trouble with my speakers not working while online particular on facebook. My audio works when playing audio files.

    Hi,
    Did it happen all the time or sometime?
    Please check online browser status:
    Click Volume icon in the taskbar, click Mixer link button as below:
    If it's fine, follow this guide to run troubleshooter to detect and fix the issue:
    Tips for fixing common sound problems
    http://windows.microsoft.com/en-in/windows/tips-fixing-common-sound-problems#tips-fixing-common-sound-problems=windows-7
    Meanwhile, this similar thread also could be referred:
    https://social.technet.microsoft.com/forums/ie/en-US/a4a1cfe5-93a5-4c0b-9bf6-f7db0304f2ba/no-sound-on-youtube-or-any-other-webpage
    Please remember to mark the replies as answers if they help, and unmark the answers if they provide no help. If you have feedback for TechNet Support, contact [email protected]

  • TS3297 i bot a 3g iphone 2nd hand and it is trobleing a lot with os and not working plese help me

    i bot a 3g iphone 2nd hand and it is trobleing a lot with os and not working plese help me

    The following guide gives information on how to sync ringtones from your computer to the phone. The reference section at the bottom of the quide also gives instructions on how to convert a song to a ringtone. https://discussions.apple.com/docs/DOC-3792

  • [svn] 4323: Bug: LCDS-544 - Scenario where two components have seperate channel sets with overlapping channels not working .

    Revision: 4323
    Author: [email protected]
    Date: 2008-12-15 19:23:10 -0800 (Mon, 15 Dec 2008)
    Log Message:
    Bug: LCDS-544 - Scenario where two components have seperate channel sets with overlapping channels not working.
    QA: Yes
    Doc: No
    Checkintests Pass: Yes
    Details:
    * Hunting to a new channel within a channelset never triggered a disconnect from the previous channel(s). This isn't a problem in general, but does becomes a problem when an app defines two distinct channelsets containing at least one shared channel at the head of the list. In this case, the first channelset hunts past it and connects on a later channel. But when the second channelset hunts through (triggering a connect fault when it hits that initial shared channel that can't connect), the fault is processed by the first channelset as well (incorrectly).
    Ticket Links:
    http://bugs.adobe.com/jira/browse/LCDS-544
    Modified Paths:
    flex/sdk/trunk/frameworks/projects/rpc/src/mx/messaging/ChannelSet.as

    Running the script by python2 solves it for me:
    su - mythtv -c "nice -n 19 python2 /usr/bin/tv_grab_nl_py --output ~/listings.xml"
    Best regards,
    Cedric

  • I have downloaded skype, but after synchronizing with itunes skype not working, why?

    i have downloaded skype, but after synchronizing with itunes skype not working, why?  when I was synchronizing I believe there was some message in itune saying software not backed up or somethin to that effect.

    Thanks for your response.
    However, I did not find any solution to my problem.
    in my phone the skype application skype is not opening up, same is the caseiwth mobile voip. Both these applications were downloaded last night and it worked then, but not working now.
    Thanks in advance for anyone willing to help. I am new to the iphone.

  • [svn] 3921: Fix for - @inheritDoc tag not working for get/ set overrides when you only override the setter of a base class

    Revision: 3921
    Author: [email protected]
    Date: 2008-10-28 06:23:00 -0700 (Tue, 28 Oct 2008)
    Log Message:
    Fix for - @inheritDoc tag not working for get/set overrides when you only override the setter of a base class
    QE Notes: Baselines for framework test will need to be updated.
    Doc Notes: None
    Reviewer: Paul
    Bugs: SDK-17304
    tests: checkintests
    Ticket Links:
    http://bugs.adobe.com/jira/browse/SDK-17304
    Modified Paths:
    flex/sdk/trunk/modules/compiler/src/java/flex2/compiler/asdoc/ASDocExtension.java
    flex/sdk/trunk/modules/compiler/src/java/flex2/compiler/asdoc/ClassTable.java

    Revision: 3921
    Author: [email protected]
    Date: 2008-10-28 06:23:00 -0700 (Tue, 28 Oct 2008)
    Log Message:
    Fix for - @inheritDoc tag not working for get/set overrides when you only override the setter of a base class
    QE Notes: Baselines for framework test will need to be updated.
    Doc Notes: None
    Reviewer: Paul
    Bugs: SDK-17304
    tests: checkintests
    Ticket Links:
    http://bugs.adobe.com/jira/browse/SDK-17304
    Modified Paths:
    flex/sdk/trunk/modules/compiler/src/java/flex2/compiler/asdoc/ASDocExtension.java
    flex/sdk/trunk/modules/compiler/src/java/flex2/compiler/asdoc/ClassTable.java

  • Hello, all of a sudden I fell down my system and completely erased all bookmarks. Your progress with restoration does not work, send me ansver,please

    Hello, all of a sudden I fell down my system and completely erased all bookmarks. Your progress with restoration does not work, write me of bookmarks could not be loaded. Please advice on everything because I came and they seriously need it.

    Did your computer crash or did Firefox crash causing the loss of the bookmarks?
    You can check for problems with the places.sqlite database file in the Firefox Profile Folder.
    *http://kb.mozillazine.org/Bookmarks_history_and_toolbar_buttons_not_working_-_Firefox
    *https://support.mozilla.org/kb/Bookmarks+not+saved#w_fix-the-bookmarks-file
    See also:
    *http://kb.mozillazine.org/Lost_bookmarks
    *http://kb.mozillazine.org/Firefox_crashes
    *https://support.mozilla.org/kb/Firefox+crashes

Maybe you are looking for

  • 8500 Premier All-in-One printer drops offline

    Periodically my wireless printer drops offline and I cannot print.  This happens randomly on different PCs on the wireless network.  Usually restarting the print spooler on the PC that cannot print solves the problem but sometimes I need to shut the

  • A little help maby??? (Find the bug)

    I made a part of a prog but there's a bug in it, plz help me... import java.util.*; class DobbelSteen      Random myRandom = new Random();      int A()           int randomNumberA = myRandom.nextInt(6);           randomNumberA = randomNumberA + 1;   

  • Application Architecture Suggestions

    Hi, I'm currently writing a library/application which will integrate with a number of systems. The application will be used by other systems to generate HTML forms, for which there are definitions stored in a database, and to store the information sa

  • Birt in jdeveloper

    Anybody know anything about integrating birt into an adf project in jdeveloper?

  • Buying the new Mac Pro

    Hi there, I want to buy the new mac pro, I am a after effect user, need to know which graphic card to select, there is two option: 1-NVIDIA GeForce GT 120 with 512MB four of them, or 2-ATI Radeon HD 4870 with 512MB of GDDR5 memory single one. Thanks