2 Replies Latest reply on Jul 1, 2011 1:58 PM by robertgary1

    JSF 2.0 in JBoss AS 6 renders <div> tag incorrectly

    robertgary1

      If you use the following xhtml tags...

      <?xml version="1.0" encoding="UTF-8"?>

      <!DOCTYPE html

              PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"

              "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

      <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"

              xmlns:h="http://java.sun.com/jsf/html">

      <body>

       

      <h:form>

              <h:panelGrid>

                  <div id="presetRanges">

                      <h:panelGrid columns="1" rendered="false">

                          <!--<h:outputText value="bar"/>-->

                      </h:panelGrid>

                  </div>

       

              </h:panelGrid>

          </h:form>

       

      </body>

      </html>

       

       

      It renders as...

       

      <?xml version="1.0" encoding="UTF-8"?>

      <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"

              "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd" >

      <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">

          <body>

              <form id="j_id1140648439_43fce9ed" name="j_id1140648439_43fce9ed" method="post"

                    action="/testJSF2Web/testPage2.jsf" enctype="application/x-www-form-urlencoded">

                  <table>

                      <tbody>

                          <tr>

                              <td>

                                  <div id="presetRanges">

                              </td>

                          </tr>

                          <tr>

                              <td>

                              </div>

                          </td>

                      </tr>

                  </tbody>

              </table>

              <input type="hidden" name="j_id1140648439_43fce9ed_SUBMIT" value="1"/>

              <input type="hidden" name="javax.faces.ViewState" id="javax.faces.ViewState"

                     value="q6SajcUugOiXkLYISx+QCHdiiJQJaJ0Jp3CJQ1RG4fxGBST1c3AxMgaZV3YCFzI9Zw0w96iHAnAMsgzyz8pgbdtPf62LeHqDS/XPyF4aZcRgRL6/wBvcghc1G/wLNvr2cnNRNw=="/>

          </form>

       

          <div id="javax_faces_developmentstage_messages"></div>

      </body>

              </html>

       

       

      Notice that the <div> tag's closing is placed in the incorrect location in the table, resulting in invalid HTML.

       

      Has anyone else seen this? Should I report an issue with MyFaces?

       

      -Robert