4 Replies Latest reply: Feb 22, 2013 4:31 AM by atarifreak73 RSS

    h:commandbutton (general forwarding), IE8 and JBoss 7.1 no html-tag and DOCTYPE rendered

    atarifreak73 Newbie

      Good afternoon!

       

      I habe a problem with this combination.

       

      When I call a forwarding with h:commandbutton under IE8 and JBoss 7.1, I get a bad rendered site without doctype and html-tag:

       

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

      The result is a incorrect layout.

       

      When I call the same under JBoss 6.1, my site is rendered correct:

       

      <?xml version="1.0" encoding="UTF-8"?>
      <!DOCTYPE html>
      <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
       <head>
      ...
      

       

      When I call the same under JBoss 7.1 directly (without use h:commandbutton) or with option "faces-redirect=true", I get also a correct rendered HTML-Site.

       

      I have this problem only with IE8 (I cant test other IE-versions). The context-param "com.sun.faces.preferXHTML" have no effect.

      In FF and Chrome it works perfectly with any JBoss.

       

      The original code:

       

      <?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"
            xmlns:a4j="http://richfaces.org/a4j"
            xml:lang="en" lang="en"
            xmlns:h="http://java.sun.com/jsf/html"
            xmlns:f="http://java.sun.com/jsf/core"
            xmlns:ui="http://java.sun.com/jsf/facelets"
            xmlns:rich="http://richfaces.org/rich">
      <h:head>
      ...
      

       

      I´m stumped. Can someone help me please??

        • 1. Re: h:commandbutton, IE8 and JBoss 7.1 no html-tag and DOCTYPE rendered
          atarifreak73 Newbie

          I have substantiate the problem. When the h:commandButton is included, then I have this effect:

           

          test.xhtml:

           

          <?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"
                xmlns:ui="http://java.sun.com/jsf/facelets">
          <h:head>
          </h:head>
          <h:body>
              <ui:include src="test_incl.xhtml" />
          </h:body>
          </html>
          
          

           

          test_incl.xhtml:

           

          <?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">
          <h:body>
              <h:form>
                   <h:commandButton value="test2" action="test2" />
              </h:form>
          </h:body>
          </html>
          
          

          A click on the commandbutton produce the wrong parsed document in IE8 and JBoss 7. Removing the body-tag have no effect for the problem.

           

          test2.xhtml:

           

          <?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"
                xmlns:a4j="http://richfaces.org/a4j"
                xml:lang="en" lang="en"
                xmlns:h="http://java.sun.com/jsf/html">
          <h:head>
          </h:head>
          <h:body>
              <h:form>
                  <h:commandButton value="test" action="test" />
              </h:form>
          </h:body>
          </html>
          
          

           

          test.xhtml and test_incl.xhtml in a single document have not the problem and produce a correct HTML-header:

           

          <?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">
          <h:head>
          </h:head>
          <h:body>
              <h:form>
                   <h:commandButton value="test2" action="test2" />
              </h:form>
          </h:body>
          </html>
          
          

           

          I think, I have a simple error in my code, but where??

          • 2. Re: h:commandbutton, IE8 and JBoss 7.1 no html-tag and DOCTYPE rendered
            atarifreak73 Newbie

            Have nobody a idea? What it´s in your opinion? A bug in my sourcecode, in IE8 or in JBoss 7.1?

             

            a bug in my sourcecode: It could always be. Please tell me, if you find them.

            a bug in IE8: The error exist only in use of IE8. It´s possible.

            a bug in JBoss 7.1: The error exist only by using JBoss 7.1. With JBoss 6.1 (and IE8) it´s fine: Also possible.

             

            How about, the JBoss 7.1 needs by forwarding in JSF special informations about the browsertype, and the IE8 don´t send it? The result is a unrendered HTML-Header?

            • 3. Re: h:commandbutton, IE8 and JBoss 7.1 no html-tag and DOCTYPE rendered
              atarifreak73 Newbie

              I have detected the similar problem in use of firefox 3.6, but there rendered indeed the browser correct xhtml with header (no problems with forwarding), but die layout is a mess.

              For example produce a click on a second Richfaces-Tab (Richfaces 4.2.2) the content under the content of the first site. The content of the first site don't hide.

               

              But this is only a effect in use of JBoss 7.1.1. The same in JBoss 6.1 - no problems.

               

              It´s possible, only modern browsers can work accurate with JBoss 7.1.1 in the standardconfig?

              • 4. Re: h:commandbutton (general forwarding), IE8 and JBoss 7.1 no html-tag and DOCTYPE rendered
                atarifreak73 Newbie

                I have identified the problem: The version of JSF in JBoss 7.1.1 (JSF 2.0.1) is bugy, after some forwardings JSF no render the DOCTYPE. The solution for this problem I have found in this thread: https://community.jboss.org/message/756572#756572

                The missing DOCTYPE are inconsiderable for the most browsers, but not for IE8. The result is a bad layout only in IE.