Uploaded image for project: 'Geronimo'
  1. Geronimo
  2. GERONIMO-3167

When JSF renders, fields are shifted

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • 2.0-M5
    • 2.0-M6
    • web
    • Security Level: public (Regular issues)
    • None
    • winxp, rev 536774

    Description

      I built "Guess Number" application from RI (from Glassfish project).
      However I noticed that when rendering JSP:
      <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
      <head> <title>Hello</title> </head>
      <%@ page contentType="text/xml" %>
      <%@ taglib uri="http://java.sun.com/jsf/html" prefix="h" %>
      <%@ taglib uri="http://java.sun.com/jsf/core" prefix="f" %>
      <body bgcolor="white">
      <f:view>
      <h:form id="helloForm" >
      <h2>Hi. My name is Duke. I'm thinking of a number from
      <h:outputText value="#

      {UserNumberBean.minimum}

      "/> to
      <h:outputText value="#

      {UserNumberBean.maximum}

      "/>. Can you guess
      it?</h2>

      <h:graphicImage id="waveImg" url="/wave.med.gif" />
      <h:inputText id="userNo" label="User Number" value="#

      {UserNumberBean.userNumber}

      "
      validator="#

      {UserNumberBean.validate}

      "/>
      <h:commandButton id="submit" action="success" value="Submit" />
      <p />
      <h:message showSummary="true" showDetail="false" style="color: red; font-family: 'New Century Schoolbook', serif; font-style: oblique; text-decoration: overline" id="errors1" for="userNo"/>

      </h:form>
      </f:view>

      <p>
      <a href="http://validator.w3.org/check?uri=referer"><img
      src="http://www.w3.org/Icons/valid-xhtml10"
      alt="Valid XHTML 1.0!" height="31" width="88" /></a>
      </p>
      </body>
      </html>

      it produces HTML output:
      <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
      <head> <title>Hello</title> </head>

      <body bgcolor="white">
      <form id="helloForm" name="helloForm" method="post" action="/guessnumber/guess/greeting.jsp;jsessionid=8127572BCEF374530312AB95A19F6A3C" enctype="application/x-www-form-urlencoded">1
      <h2>Hi. My name is Duke. I'm thinking of a number from
      10 to
      <img id="helloForm:waveImg" src="/guessnumber/wave.med.gif;jsessionid=8127572BCEF374530312AB95A19F6A3C" />. Can you guess
      it?</h2>

      <input id="helloForm:userNo" name="helloForm:userNo" type="text" value="" /><input id="helloForm:submit" name="helloForm:submit" type="submit" value="Submit" onclick="clear_helloForm();" />
      <p />
      <input type="hidden" name="helloForm:link_hidden" /><script type="text/javascript"><!--
      function clear_helloForm() {
      var f = document.forms['helloForm'];
      var elem0 = f.elements['helloForm:_link_hidden_'];
      if (elem0.value != '')

      { elem0.value=''; }
      f.target='';
      }
      clear_helloForm();
      //--></script><input type="hidden" name="helloForm_SUBMIT" value="1" /><input type="hidden" name="javax.faces.ViewState" id="javax.faces.ViewState" value="C9+lUnxFbF33IdgUBUsYs6qe3...." /></form>

      <p>
      <a href="http://validator.w3.org/check?uri=referer"><img
      src="http://www.w3.org/Icons/valid-xhtml10"
      alt="Valid XHTML 1.0!" height="31" width="88" /></a>
      </p>
      </body>
      </html>

      however I would expect something like:
      <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
      <head> <title>Hello</title> </head>



      <body bgcolor="white">
      <form id="helloForm" name="helloForm" method="post" action="/guessnumber/guess/greeting.jsp;jsessionid=8127572BCEF374530312AB95A19F6A3C" enctype="application/x-www-form-urlencoded">1
      <h2>Hi. My name is Duke. I'm thinking of a number from
      1 to 10
      . Can you guess
      it?</h2>
      <img id="helloForm:waveImg" src="/guessnumber/wave.med.gif;jsessionid=8127572BCEF374530312AB95A19F6A3C" />
      <input id="helloForm:userNo" name="helloForm:userNo" type="text" value="" /><input id="helloForm:submit" name="helloForm:submit" type="submit" value="Submit" onclick="clear_helloForm();" />
      <p />
      <input type="hidden" name="helloForm:link_hidden" /><script type="text/javascript"><!--
      function clear_helloForm() {
      var f = document.forms['helloForm'];
      var elem0 = f.elements['helloForm:_link_hidden_'];
      if (elem0.value != '') { elem0.value=''; }

      f.target='';
      }
      clear_helloForm();
      //--></script><input type="hidden" name="helloForm_SUBMIT" value="1" /><input type="hidden" name="javax.faces.ViewState" id="javax.faces.ViewState" value="C9+lUnxFbF33IdgUBUsYs6qe3...." /></form>

      <p>
      <a href="http://validator.w3.org/check?uri=referer"><img
      src="http://www.w3.org/Icons/valid-xhtml10"
      alt="Valid XHTML 1.0!" height="31" width="88" /></a>
      </p>
      </body>
      </html>

      Looks like miserable bug... But effect as if "1" gets possition of something. "10" gets right possition of "1". "/wave.med.gif" gets right possition of "10". I guess that if there were some 4th ouput element it would get position of "/wave.med.gif" and so on...

      I attach screenshot, war and zip of m2eclipse project.

      Attachments

        1. guessnumber.war
          16 kB
          Alexander Zynevich
        2. guessnumber.zip
          53 kB
          Alexander Zynevich
        3. screenshot-1.jpg
          60 kB
          Alexander Zynevich
        4. screenshot-2.jpg
          56 kB
          Alexander Zynevich

        Issue Links

          Activity

            People

              Unassigned Unassigned
              zynevich Alexander Zynevich
              Votes:
              1 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: