5 Replies Latest reply on Sep 26, 2007 5:59 AM by Christian Bauer

    Weird s:formattedText behavior

    Ales Justin Master

      Running current Seam trunk on JBossAS 4.2.1.GA.
      This is my text:

      INSERT INTO "ARTICLE" (ID,BODY) VALUES (1,'... dolor sit amet, consectetuer adipiscing elit. Quisque consequat eros in tellus. Quisque metus. Pellentesque quam risus, venenatis et, volutpat vel, rutrum non, est. Mauris nisi enim, cursus eget, condimentum eu, euismod vitae, nulla. Sed congue orci iaculis est. Suspendisse luctus. Mauris sed quam ac velit pellentesque posuere. Aenean vulputate dui. Sed elit. Proin sapien nisl, pharetra non, vehicula eu, congue eu, arcu. Ut ornare porttitor nibh. Vivamus venenatis. Donec lacus. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas.<br/><br/>Curabitur cursus ante et mauris. Nulla lectus arcu, vulputate sit amet, tristique in, ullamcorper in, neque. Class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos hymenaeos. Nunc consectetuer mi in nisi. Fusce quam sapien, scelerisque vel, fringilla sit amet, faucibus in, nunc. Etiam tortor. Maecenas lobortis. Aliquam laoreet rhoncus ante. Integer eget mauris. Phasellus adipiscing, mauris eu ultrices ultricies, sem turpis elementum urna, eu porta urna ligula quis augue. Morbi aliquet. Nunc lobortis. Maecenas viverra diam vel massa. Donec pretium consequat erat. Cras turpis. Aliquam erat sem, viverra eget, laoreet ac, pharetra ut, nunc.<br/><br/>Class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos hymenaeos. Cras ut est. Maecenas lacus. Maecenas convallis justo in lectus. Sed quam tellus, aliquam at, semper vel, ultricies sed, sapien. Integer ac pede ac tellus luctus elementum. Nunc feugiat quam id quam. Donec enim odio, elementum id, pharetra nec, aliquet a, nisi. Vestibulum quam orci, vehicula sit amet, fermentum et, pulvinar a, orci. Ut ac nisl. In aliquam mauris nec felis. Etiam eu pede in metus molestie facilisis. Mauris pulvinar tortor a risus. Etiam sed tortor sed justo pellentesque gravida. In hac habitasse platea dictumst. Nullam non quam sed lectus nonummy ultricies. Curabitur viverra. Vivamus erat.');
      


      My xhtml file:
      <ui:composition xmlns="http://www.w3.org/1999/xhtml"
       xmlns:ui="http://java.sun.com/jsf/facelets"
       xmlns:h="http://java.sun.com/jsf/html"
       xmlns:s="http://jboss.com/products/seam/taglib">
      
       <div class="article">
       <h1>#{article.title}</h1>
       <h:outputText styleClass="publishDate" value="#{article.publishDate}">
       <s:convertDateTime type="date" dateStyle="full"/>
       </h:outputText>
       <s:div rendered="#{identity.hasRole('admin')}">
       <h:outputText styleClass="creationDate" value="#{article.creationDate}">
       <s:convertDateTime type="date" dateStyle="full"/>
       </h:outputText>
       </s:div>
       <h:outputText value="#{article.author.name}" styleClass="author"/>
       <s:formattedText value="#{article.body}" styleClass="articleBody"/>
       </div>
      
      </ui:composition>


      The html output:
       <div class="article">
       <h1>Lorem ipsum</h1><span class="publishDate"></span><span class="author">John Doe</span><pre></pre><pre> " " "</pre><p>
       <q> </q> <q> <q> </q> <q> </q> <q> <q> </q><pre> " " "</pre> <q> </q><pre> " "</pre> <q> </q><pre> "</pre> <q> </q> <q> <q> </q><pre> " "</pre> <q> </q><pre> "</pre> <q> </q> <q> </q> <q> <q> </q><pre> " " " " " " "</pre> <q> </q> <q> <q> </q><pre> " " "</pre> <q> </q><pre> " "</pre> <q> </q><pre> "</pre> <q> </q> <q> </q><pre> " "</pre> <q> </q><pre> " " " " " " " " " " " " "</pre></p>
      
      <p>
      ></p>
      <p>
      ><q> </q> <q> </q> <q> <q> </q> <q> <q> </q> <q> <q> </q><pre> " "</pre> <q> <q> </q> <q> </q> <q> </q> <q> </q> <q> </q><pre> " " "</pre> <q> </q> <q> </q> <q> <q> </q> <q> <q> </q><pre> " " "</pre> <q> </q><pre> "</pre> <q> </q><pre> " "</pre> <q> </q> <q> </q><pre> " " "</pre> <q> </q><pre> " " " "</pre> <q> </q> <q> </q><pre> " " " " " "</pre> <q> </q><pre> " "</pre> <q> </q> <q> </q> <q> <q> </q> <q> </q><pre> " "</pre> <q> </q> <q> <q> </q><pre> " "</pre> <q> </q><pre> "</pre></p>
      
      <p>
      ></p>
      <p>
      ><q> </q> <q> </q> <q> </q> <q> </q> <q> </q><pre> " " "</pre> <q> </q> <q> <q> </q><pre> " " " " "</pre> <q> </q> <q> <q> </q><pre> " "</pre> <q> </q><pre> "</pre> <q> </q> <q> </q> <q> </q> <q> <q> </q> <q> </q> <q> <q> </q> <q> <q> </q><pre> " "</pre> <q> </q><pre> "</pre> <q> </q> <q> <q> </q> <q> <q> </q><pre> " "</pre> <q> <q> </q> <q> <q> </q> <q> </q> <q> <q> </q> <q> </q> <q> </q> <q> <q> </q> <q> </q> <q> <q> </q> <q> </q> <q> </q> <q> <q> </q> <q> </q> <q> <q> </q> <q> </q> <q> </q> <q> <q> </q><pre> " "</pre></p>
       </div>


      An the errors in log:
      20:22:31,078 INFO [STDOUT] Hibernate: select file0_.id as id28_, file0_1_.title as title28_, file0_1_.author_id as author5_28_, file0_1_.creationDate as creation3_28_, file0_1_.publishDate as publishD4_28_, file0_.contentType as contentT2_30_, file0_.fileContents as fileCont3_30_ from File file0_ inner join Content file0_1_ on file0_.id=file0_1_.id
      20:22:31,093 INFO [ContentManagerImpl] Got 1 files.
      20:22:31,156 ERROR [STDERR] line 1:49: unexpected token: .
      20:22:31,156 ERROR [STDERR] line 1:83: unexpected token: .
      20:22:31,156 ERROR [STDERR] line 1:186: unexpected token: ,
      20:22:31,156 ERROR [STDERR] line 1:266: unexpected token: .
      20:22:31,156 ERROR [STDERR] line 1:355: unexpected token: .
      20:22:31,156 ERROR [STDERR] line 1:581: unexpected token: <
      20:22:31,156 ERROR [STDERR] line 1:582: unexpected token: br
      20:22:31,156 ERROR [STDERR] line 1:586: unexpected token: <
      20:22:31,156 ERROR [STDERR] line 1:587: unexpected token: br
      20:22:31,156 ERROR [STDERR] line 1:622: unexpected token: .
      20:22:31,156 ERROR [STDERR] line 1:641: unexpected token: ,
      20:22:31,156 ERROR [STDERR] line 1:661: unexpected token: ,
      20:22:31,156 ERROR [STDERR] line 1:698: unexpected token: .
      20:22:31,156 ERROR [STDERR] line 1:820: unexpected token: .
      20:22:31,156 ERROR [STDERR] line 1:839: unexpected token: ,
      20:22:31,156 ERROR [STDERR] line 1:1154: unexpected token: .
      20:22:31,156 ERROR [STDERR] line 1:1215: unexpected token: ,
      20:22:31,156 ERROR [STDERR] line 1:1261: unexpected token: <
      20:22:31,156 ERROR [STDERR] line 1:1262: unexpected token: br
      20:22:31,156 ERROR [STDERR] line 1:1266: unexpected token: <
      20:22:31,156 ERROR [STDERR] line 1:1267: unexpected token: br
      20:22:31,156 ERROR [STDERR] line 1:1374: unexpected token: .
      20:22:31,156 ERROR [STDERR] line 1:1443: unexpected token: ,
      20:22:31,156 ERROR [STDERR] line 1:1534: unexpected token: .
      20:22:31,171 ERROR [STDERR] line 1:1561: unexpected token: .
      20:22:31,171 ERROR [STDERR] line 1:1578: unexpected token: ,
      20:22:31,171 ERROR [STDERR] line 1:1645: unexpected token: ,
      20:22:31,171 ERROR [STDERR] line 1:1664: unexpected token: ,
      20:22:31,171 ERROR [STDERR] line 1:1696: unexpected token: .
      20:22:31,171 ERROR [STDERR] line 1:1708: unexpected token: .
      20:22:31,171 ERROR [STDERR] line 1:1737: unexpected token: .
      20:22:31,171 ERROR [STDERR] line 1:1780: unexpected token: .
      20:22:31,171 ERROR [STDERR] line 1:1812: unexpected token: .
      20:22:31,171 ERROR [STDERR] line 1:1861: unexpected token: .
      20:22:31,171 ERROR [STDERR] line 1:1895: unexpected token: .
      20:22:31,171 ERROR [STDERR] line 1:1941: unexpected token: .
      


      OK, I could understand the dot, but br ...
      Any ideas what's going on?