10 Replies Latest reply on Jan 31, 2007 1:43 PM by David Lloyd

    Web console changes - IMPORTANT

    David Lloyd Master

      I profiled the web console performance and found that the #1 bottleneck, at least on the first run, was the ajax4jsf library. Since the last navigation restructure removed all the ajax features anyway, I went ahead and removed this library, and performance seems to be greatly improved... however I discovered a fairly catastrophic side-effect of this change.

      It turns out that ajax4jsf uses the Tidy parser to quietly "clean up" mistakes in the generated XHTML. One side-effect of this is that including a file that includes a <!DOCTYPE> header, or any html tags that are not valid within the body of an html document, causes strict XHTML parsing to break on client web browsers. This is an important revelation because we cannot always assume that the end-user is using ajax4jsf.

      Because of this, it is very important that the GPD be updated to output task forms without any containing <!DOCTYPE> or tags. I've updated the websale example to show how the task forms should look.

        • 1. Re: Web console changes - IMPORTANT
          Tom Baeyens Master

          task forms are included through facelets.

          i thought facelets rips out the doctype and everything else except what is in the body tag.

          this is how i did it before. i didn't use ajax so i don't think there was any hidden tidying going on.

          i don't think that the GPD should solve this by removing the doctype declarations from the forms generation

          • 2. Re: Web console changes - IMPORTANT
            David Lloyd Master

            Facelets does not do this. It passes the xhtml on verbatim. Some web browsers will accept this, but firefox 2.0 will give you an XML validation error. IE just ignores those elements I think (IE does not have xhtml support so it just treats it like HTML 4.01).

            The task form generation uses the facelets include mechanism just like it did before.

            By using the proper root element and not relying on filtering, it guarantees the best compatibility for user applications.

            • 3. Re: Web console changes - IMPORTANT
              Ronald van Kuijk Master

              I use doctype in all my seam pages and have no problems (FF1.5, 2.0, IE6). My seam apps use myfaces, so maybe it is a JSF-RI issue of not ripping out the doctypes. So Toms' observation is correct (since he also used myfaces)

              If I do not have doctypes in my pages, my eclipse plugin (exadel) cannot validate the pages, so I definately want the docstypes in.

              • 4. Re: Web console changes - IMPORTANT
                David Lloyd Master

                 

                "kukeltje" wrote:
                I use doctype in all my seam pages and have no problems (FF1.5, 2.0, IE6). My seam apps use myfaces, so maybe it is a JSF-RI issue of not ripping out the doctypes. So Toms' observation is correct (since he also used myfaces)

                If I do not have doctypes in my pages, my eclipse plugin (exadel) cannot validate the pages, so I definately want the docstypes in.


                Well if the difference is between being broken for everyone using the RI, and not having eclipse be able to validate the XML, I'd rather break eclipse.

                • 5. Re: Web console changes - IMPORTANT
                  Ronald van Kuijk Master

                  sorry, that was not what I meant. I agree with you, but would like to be sure there is no other solution to this... I'm searching on google now to see if it is realy the RI or maybe something else. Stay tuned

                  • 6. Re: Web console changes - IMPORTANT
                    Tom Baeyens Master

                     

                    "david.lloyd@jboss.com" wrote:
                    The task form generation uses the facelets include mechanism just like it did before.


                    Are you sure ?

                    I can remember that I struggled with that problem as well. Also I remember about facelets docs mentioning that only content inside the body tag was included. I don't remember how I actually solved it. Afaik, I already checked with firefox at the time, but I'm not sure of that.

                    Did you have a look at facelets composition, fragment, include and insert ?

                    Preferrably, we should have it working with the DOCTYPE's included in the forms. But if that is not possible, we should change the designer. Please, let Koen know asap wether or not you can get the desired behaviour out of facelets.



                    • 7. Re: Web console changes - IMPORTANT
                      Ronald van Kuijk Master

                      I could not find any references of problems with this in the RI and just looked at the seam templates for seam-gen. This also generates the doctype but that uses myfaces.... so I realy think it has something to do with the RI. Maybe we should post something there and remove it (temporarily for now)

                      • 8. Re: Web console changes - IMPORTANT
                        David Lloyd Master

                         

                        "tom.baeyens@jboss.com" wrote:
                        Did you have a look at facelets composition, fragment, include and insert ?


                        Ah, yes that is correct. The task form itself could include <ui:fragment> around the body in order to trim outside of the tags. I thought you were talking about something in the facelets API.

                        So yes, a task form could look like this:
                        <jbpm:dataform xmlns="http://www.w3.org/1999/xhtml"
                         xmlns:ui="http://java.sun.com/jsf/facelets"
                         xmlns:c="http://java.sun.com/jstl/core"
                         xmlns:h="http://java.sun.com/jsf/html"
                         xmlns:f="http://java.sun.com/jsf/core"
                         xmlns:tf="http://jbpm.org/jsf/tf"
                         xmlns:jbpm="http://jbpm.org/jsf">
                        
                         <f:facet name="header">
                         <h:outputText value="#{taskName}"/>
                         </f:facet>
                        
                         <!-- TASKFORM ROWS -->
                         <jbpm:datacell>
                         <f:facet name="header">
                         <h:outputText value="Payment ID:"/>
                         </f:facet>
                         <h:inputText value="#{var['paymentId']}"/>
                         </jbpm:datacell>
                         <jbpm:datacell>
                         <f:facet name="header">
                         <h:outputText value="Actions:"/>
                         </f:facet>
                         <!-- TASKFORM BUTTONS -->
                         <tf:saveButton value="Save"/>
                         <tf:transitionButton value="Update Books"/>
                         </jbpm:datacell>
                        
                        </jbpm:dataform>
                        


                        Or if this:

                        <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd" >
                        
                        <!-- the DOCTYPE means we are required to use html for a root element -->
                        <html xmlns="http://www.w3.org/1999/xhtml"
                         xmlns:ui="http://java.sun.com/jsf/facelets"
                         xmlns:c="http://java.sun.com/jstl/core"
                         xmlns:h="http://java.sun.com/jsf/html"
                         xmlns:f="http://java.sun.com/jsf/core"
                         xmlns:tf="http://jbpm.org/jsf/tf"
                         xmlns:jbpm="http://jbpm.org/jsf">
                        <ui:fragment>
                        
                        <jbpm:dataform>
                         <f:facet name="header">
                         <h:outputText value="#{taskName}"/>
                         </f:facet>
                        
                         <!-- TASKFORM ROWS -->
                         <jbpm:datacell>
                         <f:facet name="header">
                         <h:outputText value="Payment ID:"/>
                         </f:facet>
                         <h:inputText value="#{var['paymentId']}"/>
                         </jbpm:datacell>
                         <jbpm:datacell>
                         <f:facet name="header">
                         <h:outputText value="Actions:"/>
                         </f:facet>
                         <!-- TASKFORM BUTTONS -->
                         <tf:saveButton value="Save"/>
                         <tf:transitionButton value="Update Books"/>
                         </jbpm:datacell>
                        
                        </jbpm:dataform>
                        </ui:fragment>
                        </html>
                        



                        • 9. Re: Web console changes - IMPORTANT
                          David Lloyd Master

                           

                          "david.lloyd@jboss.com" wrote:

                          <ui:fragment>
                          


                          This should be:
                          <ui:component>


                          Sorry about the mixup.


                          • 10. Re: Web console changes - IMPORTANT
                            David Lloyd Master

                            I verified that the above form (the second one) with ui:component instead of ui:fragment does work.

                            Also I removed the comment (which was mainly for the benefit of you, the reader).