Nested (tag library) tags

hi,
here is the problem that I am facing. I have downloaded the jakarta-input.tld and placed the concerned jar file in the lib folder of web-inf.
in my jsp page I have the page directive to the tld and the mapping of the tld with the class is in the web.xml file.
now I created another (my) tld file and have followed the same process.
In my jsp I am using a tag called shuttle which is in my tld. In the doStartTag() I am printing out a complete html constructed as a string. In this html string there is another tag which belongs to the jakarta-input.tld.
When the html is spit put by the JspWriter the browser is not recongizing a tag called <input:select> which corresponds to a tag defined in jakarta-input.tld.
Other html elements are showing up properly except for this tag and its contents.
Can there be nested tags?? I believe so because when the browser encounters the start of a specific tag it calls the corresponding class and so no matter what, even in this particular situation, when the browser encounters the <input:select> tag, it should look for the corresponding class with the mappings in the web.xml???
please guide me if I am understanding it wrong. I would appreciate any kind of help.
regards.
f

here are my doStartTag() and doEndTag()....
String htmlString = "<table border=\"0\" cellspacing=\"2\" cellpadding=\"0\" height=\"116\" ><tr><td><a href=\"javascript:orderModule(0,'imageId_l');\" ><img src=\"cabo/images/sru.gif\" width=\"11\" height=\"11\" border=\"0\" alt=\"Up\" vspace=\"20\"/></a></td><td rowspan=\"2\"><input:select name=\"imageId_l\" attributes=\"<%= att %>\" optionLabels=\"<%= list1 %>\" optionValues=\"<%= vals %>\"></input:select>";
  htmlString+= "</td></tr><tr><td><a href=\"javascript:orderModule(1,'imageId_l');\"><img src=\"cabo/images/srd.gif\" width=\"11\" height=\"11\" border=\"0\" alt=\"Down\" vspace=\"20\"/></a></td></tr></table></td><td><table border=\"0\" cellspacing=\"2\" cellpadding=\"0\"><tr><td><a href=\"javascript:moveModule('imageId_l','imageId_r');\"><img src=\"cabo/images/smv.gif\" alt=\"Move Right\" width=\"18\" height=\"18\" border=\"0\" vspace=\"30\" />";
  htmlString+= "</a></td></tr><tr><td><a href=\"javascript:moveModule('imageId_r','imageId_l');\"><img src=\"cabo/images/srmv.gif\" alt=\"Move Left\" width=\"18\" height=\"18\" border=\"0\" vspace=\"20\"/></a></td></tr></table></td><td class=\"table\"><table><tr class=\"shuttle\"><td width=\"3\"></td><td>Selected</td></tr></table><table border=\"0\" cellspacing=\"2\" cellpadding=\"0\" width=\"100%\" height=\"115\"><tr><td rowspan=\"2\">";
  htmlString+= "<input:select name=\"imageId_r\" attributes=\"<%= att %>\" optionLabels=\"<%= list2 %>\"></input:select></td><td><a href=\"javascript:orderModule(0,'imageId_r');\"><img src=\"cabo/images/sru.gif\" width=\"12\" height=\"12\" border=\"0\" alt=\"Up\" vspace=\"20\"/></a></td></tr><tr><td><a href=\"javascript:orderModule(1,'imageId_r');\"><img src=\"cabo/images/srd.gif\" width=\"12\" height=\"12\" border=\"0\" alt=\"Down\" vspace=\"20\"/></a></td></tr>";
  public int doStartTag() throws JspException {
      try {
        JspWriter out = pageContext.getOut();
        out.print(htmlString);
      } catch (Exception ioException) {
      return EVAL_BODY_INCLUDE;
   public int doEndTag() throws JspException {
     try {
       pageContext.getOut().print("</table>");
     } catch (Exception ioException) {
     return EVAL_PAGE;
   }here is the output from the writer in the page
<table border="0" cellspacing="2" cellpadding="0" height="116">
  <tr>
    <td>
      <a href="javascript:orderModule(0,'imageId_l');">
        <img src="cabo/images/sru.gif" width="11" height="11" border="0"
             alt="Up" vspace="20"/>
      </a>
    </td>
    <td rowspan="2">
      <input:select name="imageId_l" attributes="<%= att %>"
                    optionLabels="<%= list1 %>" optionValues="<%= vals %>">
      </input:select>
    </td>
  </tr>
  <tr>
    <td>
      <a href="javascript:orderModule(1,'imageId_l');">
        <img src="cabo/images/srd.gif" width="11" height="11" border="0"
             alt="Down" vspace="20"/>
      </a>
    </td>
  </tr>
</table>
</td>
<td>
  <table border="0" cellspacing="2" cellpadding="0">
    <tr>
      <td>
        <a href="javascript:moveModule('imageId_l','imageId_r');">
          <img src="cabo/images/smv.gif" alt="Move Right" width="18" height="18"
               border="0" vspace="30"/>
        </a>
      </td>
    </tr>
    <tr>
      <td>
        <a href="javascript:moveModule('imageId_r','imageId_l');">
          <img src="cabo/images/srmv.gif" alt="Move Left" width="18" height="18"
               border="0" vspace="20"/>
        </a>
      </td>
    </tr>
  </table>
</td>
<td class="table">
  <table>
    <tr class="shuttle">
      <td width="3">
      </td>
      <td>Selected</td>
    </tr>
  </table>
  <table border="0" cellspacing="2" cellpadding="0" width="100%" height="115">
    <tr>
      <td rowspan="2">
        <input:select name="imageId_r" attributes="<%= att %>"
                      optionLabels="<%= list2 %>">
        </input:select>
      </td>
      <td>
        <a href="javascript:orderModule(0,'imageId_r');">
          <img src="cabo/images/sru.gif" width="12" height="12" border="0"
               alt="Up" vspace="20"/>
        </a>
      </td>
    </tr>
    <tr>
      <td>
        <a href="javascript:orderModule(1,'imageId_r');">
          <img src="cabo/images/srd.gif" width="12" height="12" border="0"
               alt="Down" vspace="20"/>
        </a>
      </td>
    </tr>
  </table>my form name is multForm
All this code is spit into jsp when I use just <shuttle></shuttle> tag .
The code above has a <input:select > tag which is not getting recognized! and so in my javascript, when a function calls for "imageId_l" which is one of the names of the <input:select> it is throwing error saying "document.multiForm[..].selectedIndex is null"
id the code thats spit out not evaluated??
regards,
f

Similar Messages

  • 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

  • Help with nesting tags (STRUTS)

    Hi,
    I'm having a few problems with the following nested tag:
    <input name="indicator_target_<bean:write name='indicators' property='indicator_id'/>" size="10" value="<bean:write name="TargetValuesActionForm" property="indicator_target_<bean:write name='indicators' property='indicator_id'/>"/>"/>
    The page returns no getter method for "indicator_target_", but i'm not trying to get the "indicator_target_" value i'm trying to get the "indicator_target_ + id" (i.e. indicator_target_23) value. For some reason the nested _<bean:write name='indicators' property='indicator_id'/> tag which is part of the input 'value' param is being ignored?
    anyone know how I can resolve this?

    One of the first rules of JSP custom tags - you cannot use a tag as an attribute to another tag. For dynamic attributes you have to use a runtime expression. - either <%= expr %> or in a JSP2.0 container ${expr} as well.
    Your "input" tag is plain template html. So you can use custom tags for the values of the attributes.
    The one that is failing is
    <bean:write name="TargetValuesActionForm" property="indicator_target_<bean:write name='indicators' property='indicator_id'/>"/>
    I am presuming you are in a logic:iterate loop, or equivalent.
    Something like this might work:
    <bean:define id="currentId"  name='indicators' property='indicator_id'/>
    <bean:write name="TargetValuesActionForm" property="<%= "indicator_target_" + currentId %>"/>However all of this is very nasty.
    And struts can do at least part of this for you with indexed properties. You might want to take a look at them.
    Hope this helps,
    evnafets

  • Nested tags with a List of Objects

    I'm having trouble getting nested tags to work. Here's an example:
    My form has a List that contains a Bean called Car as well as a getter and a setter. The Car Bean has three String attributes: color, model and manufacturer. Getters and setters are present.
    When I navigate to the form, my Action class creates a single Car and adds it to the list: when the page loads I am presented with three text fields representing my Car bean. Good.
    However when I enter some text into the fields and hit the save button I get the following error:
    Error 500: BeanUtils.populateI've read a bit about nested tags but still I can't figure out what exactly I'm doing wrong.
    Here is a small sample of the JSP code;
    <html:form action="/addCar.do">
    <nested:iterate name="carForm" property="carList" type="com.foo.bean.CarBean">
      <nested:text property="color"></nested:text>
      <nested:text property="model"></nested:text>
      <nested:text property="manufacturer"></nested:text>
    </nested:iterate>
    </html:form>Should I be doing something else to properly use a nested tag? Please let me know if more details are required.
    Thank you,
    David

    I am using crystal reports to show names of a bunch of people. insted of each name comes form different function inside the oracle package, I would like to have a single function with an array of names so that I can return it easily
    eg; board member 1 (from function 1)
    board member 2 (from function 2)
    board member 3 (from function 3)
    I should get something like board member n(from a single function that has n number of members) , so that its easy for managing the list later and reduce the code
    This sounds so silly, but i am new to both crystal and pl/sql....
    please help

  • How to use nested tag in Struts

    Hi..
    Can any one guide me how to use nested tag in Struts. So far i already tried bean tag with no error but when i try to use nested tag i got error like
    javax.servlet.ServletException: Cannot find bean: "" in any scope
    Below are my class:
    action class
    session.setAttribute ("MyDetailList", detailList);
    JSP page
    <logic:iterate id="list" name="MyDetailList">
    Company ID : <bean:write name="list" property="companyID" />
    </logic:iterate>
    For bean tag, i got no error at all and below are my code for nested tag
    action class
    session.setAttribute ("MyDetailList", detailList);
    JSP Page
    <nested:nest property="MyDetailList">
    Make : <nested:text property="make"/>
    Car ID : <nested:text property="carID"/>
    </nested:nest>
    When i run the code, i got error message
    javax.servlet.ServletException: Cannot find bean: "" in any scope
    Any body can help me?
    zul

    what am I doing wrong?You will notice above that I mentioned
    YOU CAN'T USE CUSTOM TAGS AS ATTRIBUTES TO OTHER CUSTOM TAGS
    (was that loud enough for you to notice this time)?
    Try
    <html:text styleId="instruction" styleClass="text" size="50" name="instruction" property="value"/>
    //or
    <html:text styleId="instruction" styleClass="text" size="50" property="instruction" value="<%= instruction.getValue() %>"/>
    better alternative: populate your formbean with your action and just have:
    <html:text styleId="instruction" styleClass="text" size="50" property="instruction"/>
    If you set the "instruction" property of your formBean in the action, the value will be automagically reflected here.
    Cheers,
    evnafets

  • Import XML  Nested tags

    Hi all
    Here is my XML file structure
    <book>
    <section title="My Life">
    <p>
    <ol>
    <li>item 1</li>
    <li>item 2</li>
    <li>item 3</li>
    <li>item 4
        <ol>
            <li>item 1</li>
            <li>item 2</li>
            <li>item 3</li>
        </ol>
    </li>
    </ol>
    </p>
    </section>
    </book>
    I need to do two things from my XML file
    one
    I have a problem with importing my xml file. I have nested tags in my xml file. list inside list. While I am mapping tags to styles I am hang I can’t map different styles to my nested list 2nd level list. I am working with IDCS3. Is there any way to map my nested tag?
    in short
    list level One > Item 1
    TagName: <li>
    Paragraph style>ListIndentOne
    list level Two > Item 1
    TagName: <li>
    Paragraph style>ListIndentTwo
    two
    The next problem is I need to pint the value of my tag variables into indesign document is this is possible?
    <section title="My Life">
    I need to print the value of the variable value "My Life" as title style in my document.
    thanks in advance
    reagrds
    a r u l

    Hi all
    Here is my XML file structure
    <book>
    <section title="My Life">
    <p>
    <ol>
    <li>item 1</li>
    <li>item 2</li>
    <li>item 3</li>
    <li>item 4
        <ol>
            <li>item 1</li>
            <li>item 2</li>
            <li>item 3</li>
        </ol>
    </li>
    </ol>
    </p>
    </section>
    </book>
    I need to do two things from my XML file
    one
    I have a problem with importing my xml file. I have nested tags in my xml file. list inside list. While I am mapping tags to styles I am hang I can’t map different styles to my nested list 2nd level list. I am working with IDCS3. Is there any way to map my nested tag?
    in short
    list level One > Item 1
    TagName: <li>
    Paragraph style>ListIndentOne
    list level Two > Item 1
    TagName: <li>
    Paragraph style>ListIndentTwo
    two
    The next problem is I need to pint the value of my tag variables into indesign document is this is possible?
    <section title="My Life">
    I need to print the value of the variable value "My Life" as title style in my document.
    thanks in advance
    reagrds
    a r u l

  • SOAP Help Building Request With Nested Tags

    I have been struggling with Apache SOAP to try and build a request. Specifically, I don't understand how to embed these elements into the Header and Body sections. More specifically, how to do this nested tags.
    Thanks for any advice you can provide.
    Below, is a sample of the request I need to send to the server.
    <SOAP-ENV:Envelope xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
         <SOAP-ENV:Header>
              <ContinueHeader xmlns="http://www.openuri.org/2002/04/soap/conversation/">
                   <uniqueID>111111111111111</uniqueID>
              </ContinueHeader>
         </SOAP-ENV:Header>
         <SOAP-ENV:Body>
              <subscribe xmlns="http://xxxx/xxxx/xxxx/service">
                   <comHdr>
                        <WSCredentials>
                             <UserName>xxxxxxx</UserName>
                             <Password>xxxxxxxx</Password>
                        </WSCredentials>
                   </comHdr>
              </subscribe>
         </SOAP-ENV:Body>
    </SOAP-ENV:Envelope>

    I can add the <UserName>xxxxxxx</UserName> <Password>xxxxxxxx</Password> to the body of the request using:
    Vector parms = new Vector();
    parms.addElement(new Parameter("UserName", String.class, username, null));
    parms.addElement(new Parameter("Token", String.class, password, null));
    call.setParams(parms);I just don't know how to add those tags within the <comHdr> and <WSCredentials> tags.

  • Jsf  warn about nested tag

    hi I try to make a dynamic data table wtih jsf 1.2; When I run my pr�ject on the server I have gor this warn in my server log.�s there ther e somebody who know this problem.
    My datatable code:
    <h:column id="column11" >
    <f:facet name="header" > </f:facet>
    <h:commandButton action="#{RefKayit. detaysil} " rendered="#{ RefKayit. edit1}" image="img/x. gif" id="s"></h:commandB utton>
    <h:commandButton action="#{RefKayit. detaysil1} " rendered="#{ RefKayit. edit}" image="img/x. gif" id="ss"></h: commandButton>
    </h:column>
    warn on the server log:
    23519: 09:21:18,551 WARN [HtmlResponseWriter Impl] HTML nesting warning on closing td: element input rendered by component : {Component-Path : [Class: javax.faces. component. UIViewRoot, ViewId: /TestReferansTanim. jsp][Class: javax.faces. component. html.HtmlForm, Id: tref][Class: javax.faces. component. html.HtmlDataTab le,Id: update][Class: javax.faces. component. html.HtmlColumn, Id: column11][Class: javax.faces. component. html.HtmlCommand Button,Id: ss]} not explicitly closed
    thanks
    how can � solve this warn?

    My guess is that you're not resetting state in the parent tag handlers (e.g., data set by the nested tag handlers) correctly for them to work with tag handler pooling. For some more info on this, see an article I wrote for ONJava.com a while back (the "Tag handler life cycle and instance reuse" section):
    http://www.onjava.com/pub/a/onjava/2001/11/07/jsp12.html?page=2
    or my JavaServer Pages book (O'Reilly), plug plug :-)
    http://www.thejspbook.com/
    Tomcat 4.1.x uses tag handler pooling by default, but LiteWebServer (which is my company's product, BTW) disables pooling by default. Not sure about Jetty, but it's likely that it also disables pooling. For Tomcat 4.x and LiteWebServer, you control pooling through an init parameter to the JSP servlet in the conf/web.xml file:
        <servlet>
            <servlet-name>jsp</servlet-name>
            <servlet-class>org.apache.jasper.servlet.JspServlet</servlet-class>
            <init-param>
                <param-name>enablePooling</param-name>
                <param-value>false</param-value>
            </init-param>
        </servlet>I suggest that you disable pooling in Tomcat first and see if that helps. If so, you know what the problem is and can use the hints in my article to fix it.
    Hans Bergsten (JSP and JSF EG member)

  • Loading an XML with multiple nested tags

    I've got some problems dealing with loading a nested tags XML file.
    Let's suppose I have such a very simple myxml.xml file:
    <ROWDATA>
    <ROW>
      <EMPNO>7369</EMPNO>
      <ENAME>SMITH</ENAME>
       </ROW>
    <ROW>
      <EMPNO>7902</EMPNO>
      <ENAME>FORD</ENAME>
    </ROW>
    </ROWDATA>
    I can create the following table:
    create table EMP
    empno NUMBER(4) not null,
    ename VARCHAR2(10),
    and then inserting the XML file in this way:
    insert into EMP
        (empno, ename)
      select extractvalue (column_value, '/ROW/EMPNO'),
          extractvalue (column_value, '/ROW/ENAME'),
      from   table
               (xmlsequence
              (extract
               (xmltype
                 (bfilename ('MY_DIR', 'myxml.xml'),
                   nls_charset_id ('AL32UTF8')),
                 '/ROWDATA/ROW')))
    so as to get inserted two rows into my table:
    EMPNO   ENAME
    7369         SMITH
    7902         FORD
    Now, and this is my question, let's suppose I have such a “more difficult” XML:
    <ROWDATA>
    <ROW>
      <COMPANY>
        <EMPNO>7369</EMPNO>
        <ENAME>SMITH</ENAME>
        <EMPNO>1111</EMPNO>
        <ENAME>TAYLOR</ENAME>
      </COMPANY>
    </ROW>
    <ROW>
      <COMPANY>
       <EMPNO>7902</EMPNO>
       <ENAME>FORD</ENAME>
      </COMPANY>
    </ROW>
    <ROW>
      <COMPANY>
      </COMPANY>
    </ROW>
    </ROWDATA>
    In this case it seems to me things look harder 'cause for every row that I should insert into my table, I don't know how many “empno” and “ename” I'll find for each /ROW/COMPANY and so how could I define a table since the number of empno and ename columns are “unknown”?
    According to you, in that case should I load the whole XML file in an unique XMLType column and than “managing” its content by using EXTRACT and EXTRACTVALUE built-in funcions? But this looks a very difficult job.
    My Oracle version is 10gR2 Express Edition
    Thanks in advance!

    Here's a possible solution using a single pass through the XML data :
    with sample_data as (
      select xmltype(
        '<ROWDATA>
        <ROW>
          <COMPANY>
            <EMPNO>7369</EMPNO>
            <ENAME>SMITH</ENAME>
            <EMPNO>1111</EMPNO>
            <ENAME>TAYLOR</ENAME>
          </COMPANY>
        </ROW>
        <ROW>
          <COMPANY>
           <EMPNO>7902</EMPNO>
           <ENAME>FORD</ENAME>
          </COMPANY>
        </ROW> 
      </ROWDATA>'
      ) doc
      from dual
    select min(case when node_name = 'EMPNO' then node_value end) as empno
         , min(case when node_name = 'ENAME' then node_value end) as ename
    from (
      select trunc((rownum-1)/2) as rn
           , extractvalue(value(x), '.') as node_value
           , value(x).getrootelement() as node_name
      from sample_data t
         , table(
             xmlsequence(extract(t.doc, '/ROWDATA/ROW/COMPANY/*'))
           ) x
    group by rn ;
    I would be cautious with this approach though, as I'm not sure the ROWNUM projection is entirely deterministic.
    As Jason said, it's probably safer to first apply a transformation in order to get a more friendly format.
    For example :
    <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
      <xsl:template match="node()|@*">
        <xsl:copy>
          <xsl:apply-templates select="node()|@*"/>
        </xsl:copy>
      </xsl:template>
      <xsl:template match="COMPANY">
        <xsl:apply-templates select="EMPNO"/>
      </xsl:template>
      <xsl:template match="EMPNO">
        <EMP>
          <xsl:copy-of select="."/>
          <xsl:copy-of select="following-sibling::ENAME[1]"/>
        </EMP>
      </xsl:template>
    </xsl:stylesheet>

  • Nested tags vs standard tags

    can any one explain the difference b/w nested tags and standard tags.
    what is the difference b/w nested: write and bean:write

    well,why don't you check the struts documentation to know the difference
    http://struts.apache.org/1.x/struts-taglib/tlddoc/bean/write.html
    http://struts.apache.org/1.x/struts-taglib/tlddoc/nested/tld-summary.html

  • Nested Tags and Body content

    Hi
    I am working with a set of nested tags to display error messages, but when i try to get the parent class always return null.
    I add comments in the code to "debug" the tags, and the body wrote in the jsp is displayed after the comments added in the doEndTag().
    May be this is way i can't get the parent class, but i can't find how to write the code in the jsp inside the body of the tag.
    Please give me suggestions.
    Thanks in advance

    What does your code look like? Are you catching exceptions?

  • Nesting tags?

    Hi!
    I got a problem nestings html tags in swing components like JTextPane or JEditorPane.
    As far as i know there are 2 common ways of inserting html in those components, I tried both, first:
    htmlKit.insertHTML(htmlDoc,tempPos,"<font>test</font>",0,0,javax.swing.text.html.HTML.Tag.FONT);
    ...second...
    ActionEvent actionEvent = new ActionEvent(jtpMain, 0, "insertFont");
              new HTMLEditorKit.InsertHTMLTextAction("insertFont", "<font>test</font>", HTML.Tag.A, HTML.Tag.FONT, HTML.Tag.P, HTML.Tag.FONT).actionPerformed(actionEvent);
    Doesn't matter which method i use, the html code is inserted but the created node in html documents is identified as "content", not as "font". When inserting a <br> it is identified properly as a br-node.
    Since content-nodes can not contain subnodes it is not possible to nest tags this way e.g. inserting a font-tag inside an a-tag. So when inserting tags this way all tags are written behind each other instead of being nested if i want them to.
    Well I guess i am doing something wrong....
    Can someone please post some ideas or some sample code. SOmeone probably did this before.
    Thanks!

    No one out there who did this before or had the same problem?

  • Nested tags are no longer evaluated since sp3

    Since the introduction of service pack 3 for WLS6.1, all our custom tags
              have a problem: any tag that is nested inside one of our custom tags is not
              evaluated, but just displayed as text. Before sp3 everything worked just
              fine?
              What happened?
              example:
              public class ExtendedOptionTag extends BodyTagSupport {
              protected static MessageResources messages =
              MessageResources.getMessageResources(
              "com.bmg.view.taghandler.LocalStrings" );
              public static Log log = LogFactory.getLog(
              ExtendedOptionTag.class.getName() );
              protected String text = null;
              protected boolean disabled = false;
              public boolean getDisabled() {
              return ( this.disabled );
              public void setDisabled( boolean disabled ) {
              this.disabled = disabled;
              protected String value = null;
              public String getValue() {
              return ( this.value );
              public void setValue( String value ) {
              this.value = value;
              protected String name = null;
              public String getName() {
              return ( this.name );
              public void setName( String name ) {
              this.name = name;
              protected String property = null;
              public String getProperty() {
              return ( this.property );
              public void setProperty( String property ) {
              this.property = property;
              public int doStartTag() throws JspException {
              // Initialize the placeholder for our body content
              this.text = null;
              return ( EVAL_BODY_TAG );
              public int doAfterBody() throws JspException {
              String text = bodyContent.getString();
              if ( text != null ) {
              text = text.trim();
              if ( text.length() > 0 ) {
              this.text = text;
              return ( SKIP_BODY );
              public int doEndTag() throws JspException {
              // Acquire the select tag we are associated with
              SelectTag selectTag = ( SelectTag ) pageContext.getAttribute(
              Constants.SELECT_KEY );
              if ( selectTag == null ) {
              JspException e = new JspException
              ( messages.getMessage( "optionTag.select" ) );
              RequestUtils.saveException( pageContext, e );
              throw e;
              // Generate an HTML <option> element
              StringBuffer results = new StringBuffer();
              results.append( "<option value=\"" );
              if ( value != null ) {
              results.append( value );
              } else {
              if ( name != null ) {
              Object theBean = RequestUtils.lookup( pageContext, getName(), null );
              log.debug( "The bean class is: " + theBean.getClass().getName() );
              if ( theBean == null ) {
              throw new JspTagException( messages.getMessage(
              "exceptions.nosuchbean", getName() ) );
              if ( property != null ) {
              if ( theBean instanceof
              com.bmg.bbb.business.nettingmgr.rb.NettingCalendarEntryRB ) {
              short variable = ( (
              com.bmg.bbb.business.nettingmgr.rb.NettingCalendarEntryRB )
              theBean ).getCalenderEntrySeqNo();
              value = "" + variable;
              } else {
              try {
              value = BeanUtils.getSimpleProperty( theBean, getName() );
              } catch ( NoSuchMethodException ex ) {
              // TBD GW 3/12/2001 11:34AM: improve exception handling
              throw new JspException( messages.getMessage(
              "exceptions.nosuchproperty", getProperty(), getName() ) );
              } catch ( Exception ex ) {
              throw new JspException( messages.getMessage(
              "exceptions.unsupportedexception", ex.getClass().getName(), "bmg:option",
              ex ) );
              results.append( value );
              } else {
              value = theBean.toString();
              results.append( value );
              } else {
              throw new JspTagException( messages.getMessage(
              "exceptions.exorattribute", "value", "name" ) );
              results.append( "\"" );
              if ( disabled ) {
              results.append( " disabled=\"disabled\"" );
              log.debug( "Match Value: " + value );
              if ( selectTag.isMatched( value ) ) {
              results.append( " selected=\"selected\"" );
              results.append( ">" );
              String text = text();
              if ( text == null ) {
              results.append( value );
              } else {
              results.append( text );
              results.append( "</option>" );
              // Render this element to our writer
              ResponseUtils.write( pageContext, results.toString() );
              // and reset the body text
              text = null;
              // Continue evaluating this page
              return EVAL_PAGE;
              public void release() {
              super.release();
              text = null;
              disabled = false;
              value = null;
              name = null;
              property = null;
              protected String text() throws JspException {
              return this.text;
              Folkert Schram de Jong
              Cap Gemini Ernst & Young
              Financial Services / B71 Java
              Tel. +31 (0)6-14 661 992
              

    Hi Marcel,
    I haven't tried it with XML file but i hope it may help you.
    long back i need to send one field with value null if it doesn't come in source file and if it comes then original value.
    What i did, i loaded a file which does not have this field, so in MDM Import Manager, under source hierarchy i created a field say ABC and map this field with target field and its value Null with Null, i also save this property in map using configuration options-->Automap fields when loading map = Yes
    So whenever a file come with missing field ABC, automatically this field get created and mapped with target field and its value Null with target Null.  on the other hand, If this field actually comes in Source File(Delimited, Excel) ABC then this field with its original value gets map with target field value. That time it worked fine.
    Just try and revert with result if it helps..
    Else, using PI is the best option to create that missing segment into the XML message.
    Regards,
    Mandeep Saini

  • How to apply multiple styles for nested tags in XML?

    Say you import this XML into InDesign:
    <Root>
      <strong>
        <em>Bolded and Italicized</em>
      </strong>
    </Root>
    And you have two character styles, bold and italics, to map to strong and em tags respectively.
    You will see that the text appears italicized not bolded and italicized as expected. Generally, only the innermost tag will get the style and will overwrite its parent styles.
    Notice the XML is generated dynamically and tags order is not enforced. Also, there's an additional underline tag that can be nested with these two.
    So far I have tried to use GREP styles (with paragraph styles), but these do not have effect in the XML tags.
    Other possible options not tried yet:
    Create new tags for every formatting combination. Not what I really want because I could en up with a lot of tags each one with a corresponding styles.
    Create InDesign XML rules to apply character styles automatically based on the tags
    Use character styles in the XML with the aid namespace referencing InDesign styles. Will this really work?
    What do you suggest to go for? See any other option?
    Thank you in advance.
    Juan

    I'd say that you should create tags not for appearances, but for semantic content. Specifying formatting styles in your XML betrays your lack of familiarity with the format, because the last thing you'd want to do would be to use HTML markup in the middle of your XML. If you have content that's supposed to be both bolface and oblique - say, a warning - then it's marked up as
    <warning>Never refer directly to formatting in your XML markup, only to content types!</warning>
    If I had a document that was written in the style you suggest - one with lots of overlapping local formatting - I'd look at developing a better style guide that told the writers that doing so would be bad form. Because, you know, many of the writers I deal with are addicted to forms of emphasis that do nothing useful whatsover for their readership - they only serve to overemphasize the authorial voice of the writers.
    Maybe you could tell us why you need these overlapping forms of styling, and we could suggest other InDesign formatting tools (like line styles or nested styles) that would help you get the appearance you want without crowding styling markup into your XML - where, strictly speaking, it doesn't really belong.

  • How can I nest tag within each other

    Hello,
    I am trying to nest a tag within another tag as follows:
    <h:selectitem itemValue="<fmt:formatDate value="${d}" pattern="yyyy-MM-dd hh:mm:ss" type="both"/>" itemLabel="Today"/>d is a java.util.Date variable.
    Tomcat won't accept that. What am I getting wrong?
    Thanks in advance,
    Julien.

    I don't think taglibs could be other's attribute value.
    Try using attributes:
    <fmt:formatDate value="${d}" pattern="yyyy-MM-dd hh:mm:ss" type="both" var="anyDate"/>
    <!-- Is a custom tag lib? Use pageContext.findAttribute("anyDate"); -->
    <h:selectitem itemValue="anyDate" itemLabel="Today"/>
    <!-- Does your container accept EL? (Tomcat 5 does) -->
    <h:selectitem itemValue="@{anyDate}" itemLabel="Today"/>

Maybe you are looking for

  • Error in :Posting keys for account determination

    Hi, Gurus,       please suggest the solution for the following problem.             we are selling two  types of materials, one is the  product material and the second one is the scrap material.Different type pricing procedures, sale order,delivery a

  • Dreamweaver CS6 / CC crashes after Mac OSX 10.9.3 update.

    Updated today to Dreamweaver CC, and the issue persists. My 'local' files are stored on a Windows Vista server on the LAN. Everything worked OK until 2 days ago, so I'm almost sure the issue is related to the OS update. I can open a file, work on it

  • Enable 'Attachment List' in IW21/22/23 - Notification

    Hi All, I am trying to enable the link 'Attachment List' from 'Services for Object' in transaction codes: IW21/IW22/IW23. After clicking on this link, i need to display all the email attachment available to the particular notification in the popup wh

  • Process order settlement

    Hi, when i do process order settlement , system gives error message that "maintain the settlement rule of the sender". Process order contains two co-product and i have given details in "joint production" in MRP II tab. When i checked order settlement

  • How Can You Tell if the URLRequest Variables Are Posted?

    Hi, This sounds really odd, because I happen to have three variables I am supposed to pass to an httpservice and have the results output to my Flex app. The problem is, I don't know how I can tell if a variable has been posted or not, because no matt