VRaptor + FCKEditor

3 respostas
by_stoco

Fala galera...
estou eu aqui a me aventurar a trabalhar com o VRaptor e me surgiu a necessidade de usar o FCKEditor.
Pra variar num tah funfando!

Vou postar o que estou fazendo. Estou utilizando a versão 2.4.2

Já adicionei o JAR na minha aplicação: fckeditor-java-core-2.4.2

fiz a chamada no JSP
<%@page contentType="text/html" pageEncoding="UTF-8" import="net.fckeditor.*" %>
<%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@taglib uri="http://java.fckeditor.net" prefix="fck" %>
<fck:editor instanceName="noticia.texto" >
       ${noticia.texto}
</fck:editor>
E de cara, estoura o erra na minha testa.
br.com.caelum.vraptor.view.ResultException: org.apache.jasper.JasperException: The absolute uri: http://java.fckeditor.net cannot be resolved in either web.xml or the jar files deployed with this application
E se eu coloco o código no meu web.xml a aplicação nem roda.
<?xml version="1.0" encoding="UTF-8"?>
<web-app version="2.5" xmlns="http://java.sun.com/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd">
    <display-name>História de Torcedor</display-name>

    <filter>
        <filter-name>vraptor</filter-name>
        <filter-class>br.com.caelum.vraptor.VRaptor</filter-class>
    </filter>

    <filter>
        <filter-name>Connector</filter-name>
        <filter-class>net.fckeditor.connector.ConnectorServlet</filter-class>
        <init-param>
            <param-name>load-on-startup</param-name>
            <param-value>1</param-value>
        </init-param>
    </filter>

    <filter-mapping>
        <filter-name>vraptor</filter-name>
        <url-pattern>/*</url-pattern>
        <dispatcher>REQUEST</dispatcher>
        <dispatcher>FORWARD</dispatcher>
    </filter-mapping>

    <filter-mapping>
        <filter-name>Connector</filter-name>
        <url-pattern>/fckeditor/editor/filemanager/connectors/*</url-pattern>
    </filter-mapping>

    <session-config>
        <session-timeout>
            30
        </session-timeout>
    </session-config>

    <welcome-file-list>
        <welcome-file>index.jsp</welcome-file>
    </welcome-file-list>


    <target description="Creates a stripped FCKeditor distribution" name="stripped-fckeditor-dist">
        <!-- Adapt these properties to your needs -->
        <property location="fckeditor-tmp" name="fckeditor-tmp"/>
        <property name="fckeditor-basename" value="FCKeditor_2.6.4.1"/>
        <property name="fckeditor-destfile" value="${fckeditor-basename}_clean.zip"/>
        <delete file="${fckeditor-destfile}"/>
        <unzip dest="${fckeditor-tmp}" src="${fckeditor-basename}.zip"/>
        <zip destfile="${fckeditor-destfile}">
            <zipfileset dir="${fckeditor-tmp}/fckeditor" prefix="fckeditor">
                <include name="_samples/_plugins/"/>
                <include name="editor/"/>
                <include name="fckconfig.js"/>
                <include name="*.xml"/>
                <exclude name="editor/filemanager/connectors/"/>
            </zipfileset>
        </zip>
        <delete dir="${fckeditor-tmp}"/>
    </target>

</web-app>

Alguém já passou isso ou alguém pode me ajudar a chegar à solução????

[]s

3 Respostas

Lucas_Cavalcanti

o target q vc colocou no web.xml é do ant, tem que estar no build.xml… se você tirar esse target é possível que funcione…

de qqer forma, a uri da taglib está certa? o jar está no WEB-INF/lib?

kivervinicius

Porque vc não utiliza o fckeditor direto com jquery


nesse tutorial ensina como fazer a integração em uma pagina simples. para adaptar para o jsp é muito fácil

espero ter ajudado

[]'s

kivervinicius

Ou melhor ainda, existe esse plugin tambem em jQuery que transforma todas as textareas em editores

http://nicedit.com/demos.php

vale a pena dar uma boa olhada.
:wink:

Criado 4 de junho de 2010
Ultima resposta 7 de jun. de 2010
Respostas 3
Participantes 3