3 Replies Latest reply on Apr 12, 2007 6:26 PM by Rob Jellinghaus

    Bugs in 1.2.1 blog example

    Rob Jellinghaus Novice

      I'm playing with the blog example (working on integrating some Google Web Toolkit functionality into it, which I hope to submit back to Seam a la Todd Smart's ajax4jsf booking integration).

      I'm noticing a couple of squirrelly things under JDK 1.5.0_06 and Tomcat 5.5.12. This is with a brand new install of Seam 1.2.1 and a clean webapps directory, after "ant" at Seam root and "ant deploy.tomcat" in examples/blog.

      First and most important, there's a spurious HTML tag emitted by SeamText right after the little sample one-cell table in the first post:

      <table style="border:1px solid blue;"><tr><td>Foo</td><td>Bar</td></tr></table><pre>

      The final pre is a bug.

      The thing is, though, that you don't actually see this bug in the app itself. Because despite the fact that index.xhtml and template.xhtml declare themselves as having a DOCTYPE of XHTML, they aren't actually being served as application/xhtml+xml to Firefox. I can see in Firefox that they are being rendered as text/html. So the broken tag isn't obvious because Firefox ignores bad tags like that with text/html.

      I ran into this because in my own example (for reasons I have yet to fully understand), the doctype *is* being heeded and the pages *are* getting served to Firefox as application/xhtml+xml... which fails to render because it's expecting a /pre but encounters a /div.

      However, it turns out that the Atom feed page (index.xml) IS getting served as XML... and is broken! Not only is the spurious pre tag present, but there isn't a closing /feed tag at the end. View source on the index.xml Atom feed, and paste into an XML text editor, to see these bad tags.

      I am able to fix the unclosed feed tag by swapping the f:view and feed elements (e.g. putting the f:view outermost, with the feed just inside it), which AFAIK is better Facelets style anyway.

      Shall I file JIRA entries for these?
      Cheers!
      Rob

        • 1. Re: Bugs in 1.2.1 blog example
          Rob Jellinghaus Novice

          OK, so it turns out that the spurious pre in the first blog post is due to a spurious backquote in import.sql:

          insert into blogentry (blog_name, id, title, excerpt, body, date) values ('JBoss Seam Blog', 'seamtext', 'Introducing Seam Text', ...+'<table style="border:1px solid blue;"><tr><td>Foo</td><td>Bar</td></tr></table>`', '2007-01-18 4:00')

          Take out that final backquote, and the bad pre tag vanishes.

          So the question is, should SeamText be smart enough to close dangling elements? And is it a bug that the main index.xhtml page isn't being served as application/xhtml+xml under Firefox?


          • 2. Re: Bugs in 1.2.1 blog example
            Gavin King Master

            I fixed the test data. It's probably possible (but very difficult) to get the ANTLR parser to close off dangling elements resulting from broken wikitext markup, but its much better if we just find a good way to indicate to the user that their markup is broken.

            • 3. Re: Bugs in 1.2.1 blog example
              Rob Jellinghaus Novice

              Any suggestions on that? I could look into patching that if we can come up with a reasonably simple plan. Since I'm actually planning to build a production-quality blogging app with Seam, broken markup would be a big drag, so I'm incented to fix it.

              Also, can you confirm (or not) the issue with index.xml not producing a closing /feed tag?

              Welcome back, by the way :-) Cheers!