搞定FCKeditor

原创 2006年06月26日 11:00:00

一.搞定FCKeditor
    1.下载FCKeditor_2.3(目前最新版本)
    2.下载FCKeditor-2.3(4 java的最新版本)
    3.开始解压吧
    4.建立新项目MyFCK
    5.清理FCKeditor_2.3解压开的FCKeditor文件夹
      保留如下文件,其余的格删无论。
     editor(不包括_source)、fckconfig.js、fckeditor.js、fckstyles.xml、fcktemplates.xml
      再把editor中的_source干掉。
   6. MyFCK中的目录如下:
      FCKeditor、UserFiles、test.jsp、show.jsp、WEB-INF
      其中的FCKeditor中的就是步骤5中完成的。
      UserFiles是用来上传文件夹的。其中包括Image/File/Flash三个孩子。(记住啊,要不上传的时候报错啊。嘿嘿)
      WEB-INF中的目录包括lib   web.xml   FCKeditor.tld(来自FCKeditor-2.3/src)
      lib下面有FCKeditor-2.3中解压开的FCKeditor-2.3/web/WEB-INF/lib
  7. 下面重点讲web.xml/fckconfig.js中的配置了。let's go
      1)web.xml
       全部内容如下:
       其中具体的含义自己lookup了。
       <?xml version="1.0" encoding="ISO-8859-1"?>

<web-app xmlns="http://java.sun.com/xml/ns/j2ee"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd"
    version="2.4">

  <display-name>Welcome to FCK</display-name>
  <description>
     Welcome to FCK
  </description>
  
        <servlet>
                <servlet-name>Connector</servlet-name>
                <servlet-class>com.fredck.FCKeditor.connector.ConnectorServlet</servlet-class>
                <init-param>
                        <param-name>baseDir</param-name>
                        <param-value>/UserFiles/</param-value>
                </init-param>
                <init-param>
                        <param-name>debug</param-name>
                        <param-value>true</param-value>
                </init-param>
                <load-on-startup>1</load-on-startup>
        </servlet>

        <servlet>
                <servlet-name>SimpleUploader</servlet-name>
                <servlet-class>com.fredck.FCKeditor.uploader.SimpleUploaderServlet</servlet-class>
                <init-param>
                        <param-name>baseDir</param-name>
                        <param-value>/UserFiles/</param-value>
                </init-param>
                <init-param>
                        <param-name>debug</param-name>
                        <param-value>true</param-value>
                </init-param>
                <init-param>
                        <param-name>enabled</param-name>
                        <param-value>true</param-value>
                </init-param>
                <init-param>
                        <param-name>AllowedExtensionsFile</param-name>
                        <param-value></param-value>
                </init-param>
                <init-param>
                        <param-name>DeniedExtensionsFile</param-name>
                        <param-value>php|php3|php5|phtml|asp|aspx|ascx|jsp|cfm|cfc|pl|bat|exe|dll|reg|cgi</param-value>
                </init-param>
                <init-param>
                        <param-name>AllowedExtensionsImage</param-name>
                        <param-value>jpg|gif|jpeg|png|bmp|tif</param-value>
                </init-param>
                <init-param>
                        <param-name>DeniedExtensionsImage</param-name>
                        <param-value></param-value>
                </init-param>
                <init-param>
                        <param-name>AllowedExtensionsFlash</param-name>
                        <param-value>swf|fla</param-value>
                </init-param>
                <init-param>
                        <param-name>DeniedExtensionsFlash</param-name>
                        <param-value></param-value>
                </init-param>
                <load-on-startup>1</load-on-startup>
        </servlet>

  <servlet-mapping>
    <servlet-name>Connector</servlet-name>
    <url-pattern>/FCKeditor/editor/filemanager/browser/default/connectors/jsp/connector</url-pattern>
  </servlet-mapping>
 
  <servlet-mapping>
    <servlet-name>SimpleUploader</servlet-name>
    <url-pattern>/FCKeditor/editor/filemanager/upload/simpleuploader</url-pattern>
  </servlet-mapping>
<!-- JSPC servlet mappings start -->

<!-- JSPC servlet mappings end -->
  <taglib>
     <taglib-uri>/MyFCK</taglib-uri>
     <taglib-location>/WEB-INF/FCKeditor.tld</taglib-location>
  </taglib>

</web-app>
    
2)下面是fckconfig.js了
 我只把改动的作了截图。可以参考原来的和我改动的就可以了。

添加字体了。


如果不设置除非你想把你的服务器中的资源公布于天下大白啊。

这时用于uploade的。
哈哈 就先该这些了。嘿嘿 其余的如果e文好就可以自己try。

8.哈哈 还有test.jsp和show.jsp要介绍下。嘿嘿
show.jsp简单的很啊
<%
String content = request.getParameter("content");
System.out.println(content);
out.print(content);
%>
test.jsp复杂了些。嘿嘿
<%@ page language="java" import="com.fredck.FCKeditor.*" %>
<%@ taglib uri="/MyFCK" prefix="FCK" %>
 
<html>
        <head>
                <title>
                        展示区DIY
                </title>
<script type="text/javascript" src="/MyFCK/FCKeditor/fckeditor.js"></script>
<script language="javascript">
        function preview(){
                document.forms[0].action="show.jsp";
 
                document.forms[0].target="_blank";
        document.forms[0].submit();       

}
 
        function finish(){
                document.forms[0].action="test.jsp";
 
                document.forms[0].target="";
        document.forms[0].submit();       

        }
/script>
 
<%
tring uc = "";

if(request.getParameter("content") != null){

        uc = request.getParameter("content");

        if(session.getAttribute("contentusher") != null){

                session.removeAttribute("contentusher");

        }

        session.setAttribute("contentusher",uc);
 
                out.println("<script language='javascript'>alert('保存成功');window.close();</script>");
}

%>
/head>

body bottomMargin=0 leftMargin=0 topMargin=0 rightMargin=0>

<center>               
%--

种方法调用FCKeditor

.FCKeditor自定义标签 (必须加头文件 <%@ taglib uri="/MyFCK" prefix="FCK" %> )

.script脚本语言调用 (必须引用 脚本文件 <script type="text/javascript" src="/MyFCK/FCKeditor/fckeditor.js"></script> )

.FCKeditor API 调用 (必须加头文件 <%@ page language="java" import="com.fredck.FCKeditor.*" %> )

-%>

 


form action="show.jsp" method="post" >

FCK:editor id="content" basePath="/MyFCK/FCKeditor/"

idth="700"

eight="500"

kinPath="/MyFCK/FCKeditor/editor/skins/silver/"

oolbarSet = "Default"

 

nput

/FCK:editor>
 
<div algin=center>
         <input type="button" value="预览" onclick="preview()">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<input type="button" value="完成" onclick="finish()">

</div>

/form>

 

%--

 

form action="show.jsp" method="post" target="_blank">

table border="0" width="800">

tr>

<td colspan=2>

textarea id="content" name="content" style="WIDTH: 100%; HEIGHT: 400px">input</textarea>

script type="text/javascript">

ar oFCKeditor = new FCKeditor('content') ;

FCKeditor.BasePath = "/MyFCK/FCKeditor/" ;

FCKeditor.Height = 400;

FCKeditor.ToolbarSet = "Default" ;

FCKeditor.ReplaceTextarea();

/script>


/td></tr>

tr>

<td>
 
                 <input type="button" value="预览" onclick="preview()">
</td>

<td>

         <input type="button" value="完成" onclick="finish()">

</td>

/tr>

/table>

</form>

-%>

 


%--


<form action="show.jsp" method="post" target="_blank">

%

CKeditor oFCKeditor ;

FCKeditor = new FCKeditor( request, "content" ) ;

FCKeditor.setBasePath( "/MyFCK/FCKeditor/" ) ;

FCKeditor.setValue( "input" );

ut.println( oFCKeditor.create() ) ;

>

br>

input type="submit" value="Submit">

/form>


-%>

</center>
</body>

9 大功告成。拷贝MyFCK到webapps下。starttomcat去看看吧。嘿嘿

版权声明:本文为博主原创文章,未经博主允许不得转载。

相关文章推荐

半小时轻松搞定 JUnit4

  • 2017-07-19 19:01
  • 396KB
  • 下载

一行代码搞定UIlabel的高度自适应和行距

http://www.jianshu.com/p/074328601e50 给UIlabel创建分类 UILabel+LabelHeight.h 1.在.h中写接口,传给它必要的参数 ...

彻底搞定C指针

  • 2015-08-22 23:53
  • 329KB
  • 下载

轻松搞定ExtJS.pdf

  • 2014-09-11 21:12
  • 3.18MB
  • 下载

selenium之 搞定checkbox、radiobox

网页上有时候遇到checkbox和radio,一般情况下这两种都是input标签,我们可以通过点击或者发送空格的方式进行选中试验网页代码checkandradio.html: Checkbox: ...

彻底搞定C指针

  • 2014-06-17 18:09
  • 424KB
  • 下载

搞定ARM指令集(二)--转贴

一、ARM 微处理器的指令的分类与格式   ARM微处理器的指令集是加载/存储型的,也即指令集仅能处理寄存器中的数据,而且处理结果都要放回寄存器中, 而对系统存储器的访问则需要通过专门的加载...

彻底搞定C指针

  • 2014-09-06 18:22
  • 422KB
  • 下载
内容举报
返回顶部
收藏助手
不良信息举报
您举报文章:深度学习:神经网络中的前向传播和反向传播算法推导
举报原因:
原因补充:

(最多只允许输入30个字)