4 Replies Latest reply on Nov 23, 2007 4:47 AM by demetrio812

    Problem pasting text from Word using s:formattedText

    Christophe Marcourt Newbie

      Hi,

      after typing text in "Word", I copied and pasted it in my form. Submitted it and it works. But whenever I want to display the text stored in the database I've got this error :

      java.lang.RuntimeException: line 1:61: unexpected char: 0x2019
       at org.jboss.seam.ui.UIFormattedText.encodeBegin(UIFormattedText.java:34)
       at javax.faces.render.Renderer.encodeChildren(Renderer.java:65)
       at javax.faces.component.UIComponentBase.encodeChildren(UIComponentBase.java:524)
       at org.ajax4jsf.framework.renderer.RendererBase.renderChild(RendererBase.java:252)
       at org.richfaces.renderkit.AbstractRowsRenderer.encodeCellChildren(AbstractRowsRenderer.java:252)
       at org.richfaces.renderkit.AbstractTableRenderer.encodeOneRow(AbstractTableRenderer.java:168)
       at org.richfaces.renderkit.AbstractRowsRenderer.process(AbstractRowsRenderer.java:75)
       at org.ajax4jsf.ajax.repeat.SequenceDataModel.walk(SequenceDataModel.java:101)
       at org.ajax4jsf.ajax.repeat.UIDataAdaptor.walk(UIDataAdaptor.java:855)
       at org.richfaces.renderkit.AbstractRowsRenderer.encodeRows(AbstractRowsRenderer.java:92)
       at org.richfaces.renderkit.AbstractRowsRenderer.encodeChildren(AbstractRowsRenderer.java:124)
       at javax.faces.component.UIComponentBase.encodeChildren(UIComponentBase.java:524)
       at com.sun.facelets.tag.jsf.ComponentSupport.encodeRecursive(ComponentSupport.java:244)
       at com.sun.facelets.tag.jsf.ComponentSupport.encodeRecursive(ComponentSupport.java:249)
       at com.sun.facelets.tag.jsf.ComponentSupport.encodeRecursive(ComponentSupport.java:249)
       at com.sun.facelets.tag.jsf.ComponentSupport.encodeRecursive(ComponentSupport.java:249)
       at com.sun.facelets.FaceletViewHandler.renderView(FaceletViewHandler.java:573)
       at org.ajax4jsf.framework.ViewHandlerWrapper.renderView(ViewHandlerWrapper.java:108)
       at org.ajax4jsf.framework.ajax.AjaxViewHandler.renderView(AjaxViewHandler.java:229)
       at org.apache.myfaces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:384)
       at javax.faces.webapp.FacesServlet.service(FacesServlet.java:138)
       at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
       at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
       at org.jboss.seam.servlet.SeamRedirectFilter.doFilter(SeamRedirectFilter.java:29)
       at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
       at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
       at org.jboss.seam.servlet.SeamExceptionFilter.doFilter(SeamExceptionFilter.java:43)
       at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
       at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
       at org.ajax4jsf.framework.ajax.xmlfilter.BaseXMLFilter.doXmlFilter(BaseXMLFilter.java:96)
       at org.ajax4jsf.framework.ajax.xmlfilter.BaseFilter.doFilter(BaseFilter.java:220)
       at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
       at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
       at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
       at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
       at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
       at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
       at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178)
       at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:175)
       at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:432)
       at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:74)
       at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)
       at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
       at org.jboss.web.tomcat.tc5.jca.CachedConnectionValve.invoke(CachedConnectionValve.java:156)
       at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107)
       at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
       at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:869)
       at org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java
      :664)
       at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527)
       at org.apache.tomcat.util.net.MasterSlaveWorkerThread.run(MasterSlaveWorkerThread.java:112)
       at java.lang.Thread.run(Thread.java:619)
      Caused by: line 1:61: unexpected char: 0x2019
       at org.jboss.seam.text.SeamTextLexer.nextToken(SeamTextLexer.java:203)
       at antlr.TokenBuffer.fill(TokenBuffer.java:69)
       at antlr.TokenBuffer.LA(TokenBuffer.java:80)
       at antlr.LLkParser.LA(LLkParser.java:52)
       at org.jboss.seam.text.SeamTextParser.line(SeamTextParser.java:677)
       at org.jboss.seam.text.SeamTextParser.paragraph(SeamTextParser.java:345)
       at org.jboss.seam.text.SeamTextParser.text(SeamTextParser.java:286)
       at org.jboss.seam.text.SeamTextParser.startRule(SeamTextParser.java:173)
       at org.jboss.seam.ui.UIFormattedText.encodeBegin(UIFormattedText.java:30)
       ... 50 more


      I'm using s:formattedText to display the text.
      I'm using seam 1.2.1 and JBoss 4.0.5.

      I know it's "bad chars" from "Word" but can I avoid this error ?

      Cheers.

      Christophe.