jsf-2richfacesjboss6.xjboss-seam

editor.ecss and en.js not loaded richfaces 4


I am migrating a richfaces 3.x, jsf 1.x, jboss-seam 2.2 to richfaces 4.x, jsf 2.x and jboss-seam 2.3. I have a rich:editor tag inside a popupPanel which is ajax loaded. The ckeditor.js.seam?ln=org.richfaces.ckeditor:16 is trying to load the editor.ecss and en.js, but i get a 404 for both of these and an error in the console cannot read property options of undefined at ckeditor.js.seam?ln=org.richfaces.ckeditor:49. The code goes as follows

<rich:tabPanel switchType="ajax">
  <rich:tab>
   <a4j:commandButton value="loadComments" render="addCommentModalPanel"
           oncomplete="RichFaces.ui.PopupPanel.showPopupPanel('addCommentModalPanel');" />
  </rich:tab>
</rich:tabPanel>

<rich:popupPanel>
  <div>
   <rich:editor value="#{someBean.getValues}"/>
 </div>
</rich:popupPanel>

PS: I also see the editor.ecss file richfaces-components-ui jar.


Solution

  • I was using servlet below 2.5, so i had to define the resource servlet in the web.xml as follows which solved the issue. Thanks if anybody saw this question and invested their time to solve this, i have solved it myself.

    <servlet>
        <servlet-name>Resource Servlet</servlet-name>
        <servlet-class>org.richfaces.webapp.ResourceServlet</servlet-class>
        <load-on-startup>1</load-on-startup>
    </servlet>
    
    <servlet-mapping>
        <servlet-name>Resource Servlet</servlet-name>
        <url-pattern>/org.richfaces.resources/*</url-pattern>
    </servlet-mapping>