<%@ page contentType="text/html;charset=utf-8"%>
<%@ taglib uri="/WEB-INF/FCKeditor.tld" prefix="FCK"%>
<script type="text/javascript" src="/FCKeditor/fckeditor.js"></script>
<%@ page language="java" import="net.fckeditor.*"%>
<html>
<head>
<title>Welcome</title> </head>
<body>
<form name="form1" action='success.jsp' method="post">
第一种方式
 <FCK:editor id="content" width="80%" height="320"
fontNames="宋体;黑体;隶书;楷体_GB2312;Arial;Comic Sans MS;Courier 
New;Tahoma;Times New Roman;Verdana"
imageBrowserURL="/fkctest/FCKeditor/editor/filemanager/browser/default/browser.html?
Type=Image&Connector=connectors/jsp/connector"
linkBrowserURL="/fkctest/FCKeditor/editor/filemanager/browser/default/browser.html?
Connector=connectors/jsp/connector"
flashBrowserURL="/fkctest/FCKeditor/editor/filemanager/browser/default/browser.html?
Type=Flash&Connector=connectors/jsp/connector"
imageUploadURL="/fkctest/FCKeditor/editor/filemanager/upload/simpleuploader?Type=Image"
linkUploadURL="/fkctest/FCKeditor/editor/filemanager/upload/simpleuploader?Type=File"
flashUploadURL="/fkctest/FCKeditor/editor/filemanager/upload/simpleuploader?Type=Flash"> </FCK:editor> <br>
第二种方式
<textarea id="content" name="content"
style="WIDTH: 100%; HEIGHT: 400px">input</textarea>
<script type="text/javascript">
var oFCKeditor = new FCKeditor('content') ;
oFCKeditor.BasePath = "/fcktest/FCKeditor/" ;
oFCKeditor.Height = 400;
oFCKeditor.ToolbarSet = "Default" ; 
oFCKeditor.ReplaceTextarea();
</script>
<br>
第三种方式
<%
FCKeditor oFCKeditor;
oFCKeditor = new FCKeditor(request, "content");
oFCKeditor.setBasePath("/fcktest/FCKeditor/");
oFCKeditor.setValue("input");
out.println(oFCKeditor.createHtml());
%> <input type="submit" name="SubM" value="发表" />
</form>
</body>
</html>
 
第一种和第二种出错
第三种正确的
第一种出错信息:/index.jsp(12,3) According to the TLD or the tag file, attribute instanceName is mandatory for tag editor
第二种出错信息是找不到FCKeditor这个js对象
我在页面导入了相应的js和tld标签,在eclipse都能点进去
都有对应的信息,为什么说找不到js对象或对应标签呢?

解决方案 »

  1.   

    js出错信息是
    Line:18
    Char:4
    Code:0
    Error:'FCKeditor' 未定义
    网址:http://localhost:8080/fcktest/index.jsp
      

  2.   

    1 到http://sourceforge.net/project/showfiles.php?group_id=75348&package_id=129511&abmode=1
    下载 fckeditor-java-demo-2.4.war
    2 拷贝到tomcat的webapp下直接运行3 拷贝fckeditor和userfiles文件夹到项目4 拷贝WEB-INF\lib下的jar包到项目5 web.xml内容拷贝    <servlet>
            <servlet-name>Connector</servlet-name>
            <servlet-class>
                net.fckeditor.connector.ConnectorServlet
            </servlet-class>
            <load-on-startup>1</load-on-startup>
        </servlet>    <servlet-mapping>
            <servlet-name>Connector</servlet-name>
            <url-pattern>
                /fckeditor/editor/filemanager/connectors/*
            </url-pattern>
        </servlet-mapping>
    6 拷贝WEB-INF\classes下的文件fckeditor.properties到classpath下,这里默认配置的是用户权限的属性,如果不设置会提示"the current user isn't ..........."7 对demo1.jsp进行内容拷贝!
      

  3.   

    khjkhkhj