14 Replies Latest reply on Mar 7, 2007 5:54 PM by Siarhei Dudzin

    s:formattedText

    Siarhei Dudzin Apprentice

      Hi All,

      Is anybody using <s:formattedText />? I have problems with new lines not appearing below images. Should I create JIRA issue?

      Regards,
      Siarhei

        • 1. Re: s:formattedText
          Gavin King Master

          You need two newlines to indicate a paragraph break. This is pretty standard for wikitext.

          • 2. Re: s:formattedText
            Siarhei Dudzin Apprentice

            The problem (at this moment) looks like as if there are any unexpected tags (like I had tried to use full wiki syntax), attributes or even spaces the whole syntax after the error may have unexpected results.
            For example, having an image at the end of a line in a list produces the mentioned above problem with the following syntax:

            <img src="http://www.jboss.com/images/banners/jb_cert_ani_banner.gif" />


            as a result the next line (no matter how many new lines I have after the image) does not start from the new line which in turns introduces cascades of errors (with lists and some other hierarchical elements).

            I can also see that this produces errors in the log:

            line 1:723: expecting WORD, found '/'
            line 1:1061: expecting NEWLINE, found '?'
            line 1:1062: expecting LT, found '?'


            (only the first line is actually problem with the image and the rest is 'cascading' problems)

            However, if I delete the space before '/':
            <img src="http://www.jboss.com/images/banners/jb_cert_ani_banner.gif"/>


            Everything is ok, no errors in the log and formatting is as expected.

            • 3. Re: s:formattedText
              Gavin King Master

              I just fixed this in CVS. Please try it out, thanks.

              • 4. Re: s:formattedText
                Siarhei Dudzin Apprentice

                I am unable to verify it due to the following exception when trying to reach my 'editor' page (was working with 1.2.0PATCH yesterday):

                [22:43:51.671] Error Rendering View[/cms/cpanel/admin/editgeneralarticle.xhtml]
                [22:43:51.671] javax.faces.el.EvaluationException: /cms/cpanel/admin/editgeneralarticle.xhtml @61,61 value="#{imageAction.subDirItems}": Exception getting value of property subDirItems of base of type : org.emaps.myfaces.ImageActionBean_$$_javassist_3
                [22:43:51.671] at com.sun.facelets.el.LegacyValueBinding.getValue(LegacyValueBinding.java:60)
                [22:43:51.671] at javax.faces.component.UISelectItems.getValue(UISelectItems.java:58)
                [22:43:51.671] at org.apache.myfaces.shared_impl.util.SelectItemsIterator.hasNext(SelectItemsIterator.java:105)
                [22:43:51.671] at org.apache.myfaces.shared_impl.renderkit.RendererUtils.internalGetSelectItemList(RendererUtils.java:450)
                [22:43:51.671] at org.apache.myfaces.shared_impl.renderkit.RendererUtils.getSelectItemList(RendererUtils.java:428)
                [22:43:51.671] at org.apache.myfaces.shared_impl.renderkit.html.HtmlRendererUtils.internalRenderSelect(HtmlRendererUtils.java:294)
                [22:43:51.671] at org.apache.myfaces.shared_impl.renderkit.html.HtmlRendererUtils.renderMenu(HtmlRendererUtils.java:267)
                [22:43:51.671] at org.apache.myfaces.shared_impl.renderkit.html.HtmlMenuRendererBase.encodeEnd(HtmlMenuRendererBase.java:59)
                [22:43:51.671] at javax.faces.component.UIComponentBase.encodeEnd(UIComponentBase.java:539)
                [22:43:51.671] at org.ajax4jsf.framework.renderer.RendererBase.renderChild(RendererBase.java:249)
                [22:43:51.671] at org.ajax4jsf.framework.renderer.RendererBase.renderChildren(RendererBase.java:225)
                [22:43:51.671] at org.ajax4jsf.framework.renderer.AjaxContainerRenderer.encodeChildren(AjaxContainerRenderer.java:88)
                [22:43:51.671] at javax.faces.component.UIComponentBase.encodeChildren(UIComponentBase.java:527)
                [22:43:51.671] at com.sun.facelets.tag.jsf.ComponentSupport.encodeRecursive(ComponentSupport.java:244)
                [22:43:51.671] at com.sun.facelets.tag.jsf.ComponentSupport.encodeRecursive(ComponentSupport.java:249)
                [22:43:51.671] at com.sun.facelets.tag.jsf.ComponentSupport.encodeRecursive(ComponentSupport.java:249)
                [22:43:51.671] at com.sun.facelets.FaceletViewHandler.renderView(FaceletViewHandler.java:573)
                [22:43:51.671] at org.ajax4jsf.framework.ViewHandlerWrapper.renderView(ViewHandlerWrapper.java:101)
                [22:43:51.671] at org.ajax4jsf.framework.ajax.AjaxViewHandler.renderView(AjaxViewHandler.java:221)
                [22:43:51.671] at org.apache.myfaces.lifecycle.RenderResponseExecutor.execute(RenderResponseExecutor.java:41)
                [22:43:51.671] at org.apache.myfaces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:132)
                [22:43:51.671] at javax.faces.webapp.FacesServlet.service(FacesServlet.java:140)
                [22:43:51.671] at com.caucho.server.dispatch.ServletFilterChain.doFilter(ServletFilterChain.java:106)
                [22:43:51.671] at org.apache.myfaces.webapp.filter.ExtensionsFilter.doFilter(ExtensionsFilter.java:147)
                [22:43:51.671] at com.caucho.server.dispatch.FilterFilterChain.doFilter(FilterFilterChain.java:70)
                [22:43:51.671] at org.jboss.seam.web.ExceptionFilter.doFilter(ExceptionFilter.java:57)
                [22:43:51.671] at com.caucho.server.dispatch.FilterFilterChain.doFilter(FilterFilterChain.java:70)
                [22:43:51.671] at org.jboss.seam.web.RedirectFilter.doFilter(RedirectFilter.java:45)
                [22:43:51.671] at com.caucho.server.dispatch.FilterFilterChain.doFilter(FilterFilterChain.java:70)
                [22:43:51.671] at org.ajax4jsf.framework.ajax.xmlfilter.BaseXMLFilter.doXmlFilter(BaseXMLFilter.java:75)
                [22:43:51.671] at org.ajax4jsf.framework.ajax.xmlfilter.BaseFilter.doFilter(BaseFilter.java:213)
                [22:43:51.671] at com.caucho.server.dispatch.FilterFilterChain.doFilter(FilterFilterChain.java:70)
                [22:43:51.671] at com.caucho.server.webapp.WebAppFilterChain.doFilter(WebAppFilterChain.java:173)
                [22:43:51.671] at com.caucho.server.dispatch.ServletInvocation.service(ServletInvocation.java:229)
                [22:43:51.671] at com.caucho.server.http.HttpRequest.handleRequest(HttpRequest.java:274)
                [22:43:51.671] at com.caucho.server.port.TcpConnection.run(TcpConnection.java:511)
                [22:43:51.671] at com.caucho.util.ThreadPool.runTasks(ThreadPool.java:516)
                [22:43:51.671] at com.caucho.util.ThreadPool.run(ThreadPool.java:442)
                [22:43:51.671] at java.lang.Thread.run(Thread.java:595)
                [22:43:51.671] Caused by: javax.faces.el.EvaluationException: Bean: org.emaps.myfaces.ImageActionBean_$$_javassist_3, property: subDirItems
                [22:43:51.671] at org.apache.myfaces.el.PropertyResolverImpl.getProperty(PropertyResolverImpl.java:461)
                [22:43:51.671] at org.apache.myfaces.el.PropertyResolverImpl.getValue(PropertyResolverImpl.java:85)
                [22:43:51.671] at org.apache.myfaces.custom.security.SecurityContextPropertyResolver.getValue(SecurityContextPropertyResolver.java:101)
                [22:43:51.671] at com.sun.facelets.el.LegacyELContext$LegacyELResolver.getValue(LegacyELContext.java:141)
                [22:43:51.671] at com.sun.el.parser.AstValue.getValue(AstValue.java:117)
                [22:43:51.671] at com.sun.el.ValueExpressionImpl.getValue(ValueExpressionImpl.java:192)
                [22:43:51.671] at com.sun.facelets.el.TagValueExpression.getValue(TagValueExpression.java:71)
                [22:43:51.671] at com.sun.facelets.el.LegacyValueBinding.getValue(LegacyValueBinding.java:56)
                [22:43:51.671] ... 38 more
                [22:43:51.671] Caused by: java.lang.reflect.InvocationTargetException
                [22:43:51.671] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
                [22:43:51.671] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
                [22:43:51.671] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
                [22:43:51.671] at java.lang.reflect.Method.invoke(Method.java:585)
                [22:43:51.671] at org.apache.myfaces.el.PropertyResolverImpl.getProperty(PropertyResolverImpl.java:457)
                [22:43:51.671] ... 45 more
                [22:43:51.671] Caused by: java.lang.IllegalArgumentException: could not set field value: imageAction.image
                [22:43:51.671] at org.jboss.seam.Component.setFieldValue(Component.java:1559)
                [22:43:51.671] at org.jboss.seam.Component.access$500(Component.java:135)
                [22:43:51.671] at org.jboss.seam.Component$BijectedField.set(Component.java:2285)
                [22:43:51.671] at org.jboss.seam.Component.injectAttributes(Component.java:1368)
                [22:43:51.671] at org.jboss.seam.Component.inject(Component.java:1195)
                [22:43:51.671] at org.jboss.seam.interceptors.BijectionInterceptor.aroundInvoke(BijectionInterceptor.java:46)
                [22:43:51.671] at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:69)
                [22:43:51.671] at org.jboss.seam.interceptors.ManagedEntityIdentityInterceptor.aroundInvoke(ManagedEntityIdentityInterceptor.java:37)
                [22:43:51.671] at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:69)
                [22:43:51.671] at org.jboss.seam.interceptors.RollbackInterceptor.aroundInvoke(RollbackInterceptor.java:34)
                [22:43:51.671] at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:69)
                [22:43:51.671] at org.jboss.seam.interceptors.MethodContextInterceptor.aroundInvoke(MethodContextInterceptor.java:27)
                [22:43:51.671] at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:69)
                [22:43:51.671] at org.jboss.seam.intercept.RootInterceptor.invoke(RootInterceptor.java:103)
                [22:43:51.671] at org.jboss.seam.intercept.JavaBeanInterceptor.interceptInvocation(JavaBeanInterceptor.java:151)
                [22:43:51.671] at org.jboss.seam.intercept.JavaBeanInterceptor.invoke(JavaBeanInterceptor.java:87)
                [22:43:51.671] at org.emaps.myfaces.ImageActionBean_$$_javassist_3.getSubDirItems(ImageActionBean_$$_javassist_3.java)
                [22:43:51.671] ... 50 more
                [22:43:51.671] Caused by: java.lang.IllegalArgumentException: Could not set field value by reflection: ImageActionBean.image on: org.emaps.myfaces.ImageActionBean with value: class org.jboss.seam.core.Image
                [22:43:51.671] at org.jboss.seam.util.Reflections.set(Reflections.java:75)
                [22:43:51.671] at org.jboss.seam.Component.setFieldValue(Component.java:1555)
                [22:43:51.671] ... 66 more
                [22:43:51.671] Caused by: java.lang.IllegalArgumentException
                [22:43:51.671] at sun.reflect.UnsafeObjectFieldAccessorImpl.set(UnsafeObjectFieldAccessorImpl.java:63)
                [22:43:51.671] at java.lang.reflect.Field.set(Field.java:656)
                [22:43:51.671] at org.jboss.seam.util.Reflections.set(Reflections.java:61)
                [22:43:51.671] ... 67 more
                


                Not sure yet what the reason is though...

                • 5. Re: s:formattedText
                  Pete Muir Master

                  Can you post the source to ImageActionBean and to the class referenced by ImageActionBean.image?

                  The reason is that I just added an "image" component to Seam - but that shouldn't break your code like that...

                  • 6. Re: s:formattedText
                    Siarhei Dudzin Apprentice

                    Do you need the whole source or just the parts with injections and namings?

                    I also have a component called image, and from what I see a component with key 'image' and value 'org.jboss.seam.core.image' is added to factory value bindings...

                    • 7. Re: s:formattedText
                      Pete Muir Master

                      Injections and namings

                      • 8. Re: s:formattedText
                        Siarhei Dudzin Apprentice

                        The controller:

                        import org.emaps.dao.Image;
                        ...
                        
                        @Name("imageAction")
                        @Scope(ScopeType.CONVERSATION)
                        public class ImageActionBean implements Serializable {
                        
                         @Logger
                         private Log logger;
                        
                         @In(create = true)
                         private EntityManager em;
                        
                         @In(required=false)
                         @Out(required=false)
                         private Generalarticle selectedArticle;
                        
                         @In(required=false)
                         @Out(required=false)
                         private Image image;


                        and the pojo:

                        @Entity
                        public class Image implements java.io.Serializable {


                        • 9. Re: s:formattedText
                          Siarhei Dudzin Apprentice

                          I am not sure if that's the cause but compoents.xml from seam have the following entry:


                          <factory scope="stateless" auto-create="true" name="image" value="#{org.jboss.seam.core.image}" />


                          Should it have more unique name?

                          • 10. Re: s:formattedText
                            Pete Muir Master

                            Ah so you don't have a Seam component called image in your project (that references your image entity) - do you have a factory? That would be your problem ;)

                            Anyway, the simple answer is to rename your component I guess :( Sorry

                            • 11. Re: s:formattedText
                              Pete Muir Master

                               

                              "svadu" wrote:
                              I am not sure if that's the cause but compoents.xml from seam have the following entry:


                              <factory scope="stateless" auto-create="true" name="image" value="#{org.jboss.seam.core.image}" />


                              Should it have more unique name?


                              Yeah, this is the problem. Perhaps it should have a better name - but I can't think of one off the top of my head. Suggestions?

                              • 12. Re: s:formattedText
                                Siarhei Dudzin Apprentice

                                That's right (my mistake) I didn't name it (and it worked by default which is nice untill a seam component 'image' didnt appear :) ). Would it be possible (as long term solution) to rename it, I am sure many people will encounter problem like that...

                                • 13. Re: s:formattedText
                                  Siarhei Dudzin Apprentice

                                  Just FYI, I've explicitly named the component @Name("image") and the problem persists... renaming it as temporarily workaround :)

                                  • 14. Re: s:formattedText
                                    Siarhei Dudzin Apprentice

                                    @Gavin: the problem with the is solved s:formattedText is solved.