2012-10-18 47 views
1

我想在我的spring mvc中使用Fckeditor。你能否提供指导或链接来逐步设置?FKeditor和Spring MVC Maven集成步骤

我做了下面的步骤,但是当我运行时,404找不到[/springmvc/fckeditor/editor/fckeditor.html]显示。

你能检查我是什么错,并指导我吗?

首先,根据文档,我在pom.xml中添加了以下代码。

<dependency> 
    <groupId>net.fckeditor</groupId> 
    <artifactId>java-core</artifactId> 
    <version>2.6</version> 
</dependency> 

而在web.xml文件中,我添加了下面的代码。

<servlet> 
     <servlet-name>ConnectorServlet</servlet-name> 
     <servlet-class> 
      net.fckeditor.connector.ConnectorServlet 
     </servlet-class> 
     <load-on-startup>1</load-on-startup> 
</servlet> 

<servlet-mapping> 
    <servlet-name>ConnectorServlet</servlet-name> 
    <url-pattern> 
    /resources/fckeditor/editor/filemanager/connectors/* 
    </url-pattern> 
</servlet-mapping> 

之后我下载了FCKeditor_2.6.8.zip文件并解压到src/main/resources文件夹中。

在jsp页面中,我添加了taglib,javascript和标记。

<%@ taglib uri="http://java.fckeditor.net" prefix="FCK" %>

function FCKeditor_OnComplete(editorInstance) { 
    window.status = editorInstance.Description; 
} 
<FCK:editor instanceName="EditorDefault"> 
    <jsp:attribute name="value">This is some <strong>sample text 
     </strong>. You are using <a href="http://www.fckeditor.net"> 
     FCKeditor</a>. 
    </jsp:attribute> 
</FCK:editor> 

但FCKEDITOR仍然没有工作。

你能指导我哪个是错的吗?

谢谢

回答

2

我已经使用CKEditor的,下面是configrations

<dependency> 
     <groupId>com.ckeditor</groupId> 
     <artifactId>ckeditor-java-core</artifactId> 
     <version>3.5.3</version> 
    </dependency> 

在JSP文件

<%@ taglib prefix="ckeditor" uri="http://ckeditor.com"%> 
     <script type="text/javascript" src="%=request.getContextPath()%>/common/script/ckeditor/ckeditor.js"></script> 
<form:textarea path="body" maxlength="5000" />              <ckeditor:replace replace="body" basePath="../ckeditor/" /> 

确保您还复制js文件并把它复制,并在指定它jsp

+0

谢谢Jigar Parekh。它现在按照你的指示工作。对我而言,我需要将ckeditor放置在资源文件夹中。 – user1542487

+0

很高兴知道问题解决了,接受答案,这样也可以帮助别人。 –