`

FCkjava三种调用方法

    博客分类:
  • java
阅读更多

<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ taglib uri="/FCKeditor" prefix="FCK" %>
<%@ page language="java" import="com.fredck.FCKeditor.*" %>  


<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
   <head>
    
     <title>测试FCK</title>
    
     <meta http-equiv="pragma" content="no-cache">
     <meta http-equiv="cache-control" content="no-cache">
     <meta http-equiv="expires" content="0">    
     <meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
     <meta http-equiv="description" content="This is my page">
     <!--
     <link rel="stylesheet" type="text/css" href="styles.css">
     -->

   </head>
<body>

方法一:<br>

<form action="show.jsp" method="post" target="_blank">  
     <FCK:editor id="content" basePath="/db/fckeditor/" width="600" height="480" skinPath="/db/fckeditor/editor/skins/silver/"  
toolbarSet = "Default" >  
     默认内容测试
     </FCK:editor>  
     <input type="submit" value="Submit">  
</form>  

<br><br><br>

方法二:<br>
<form action="show.jsp" method="post" target="_blank">  
<%  
FCKeditor oFCKeditor ;  
oFCKeditor = new FCKeditor(request,"content") ;  
oFCKeditor.setBasePath( "/db/fckeditor/" ) ;
oFCKeditor.setWidth("600");
oFCKeditor.setHeight("480");
oFCKeditor.setValue( "input" );  
out.println( oFCKeditor.create() ) ;  
%>  
<input type="submit" value="Submit">  
</form>
<br> <br><br>
方法三:
<script type="text/javascript" src="fckeditor/fckeditor.js"></script>

<form action="show.jsp" method="post" target="_blank">  
<table border="0" width="700"><tr><td>  
<textarea id="content" name="content" style="WIDTH: 100%; HEIGHT: 400px">
input</textarea>  
<script type="text/javascript">  
var oFCKeditor = new FCKeditor('content');
oFCKeditor.BasePath = "/db/fckeditor/" ;  
oFCKeditor.Height = 400;
oFCKeditor.Width=600;
oFCKeditor.ToolbarSet = "Default" ;  
oFCKeditor.ReplaceTextarea();  
</script>  
<input type="submit" value="Submit">  
</td></tr></table>  
</form>  

   </body>
</html>

web.xml ---------------------------- -------------------其它说明

<web-app>
         <servlet>
                 <servlet-name>Connector</servlet-name>
                 <servlet-class>com.fredck.FCKeditor.connector.ConnectorServlet</servlet-class>
                 <init-param>
                         <param-name>baseDir</param-name>
将在FCKeditor/editor/下创建Image和Flash文件夹,用于存放上传文件
                         <param-value>/editor/</param-value>
                 </init-param>
                 <init-param>
                         <param-name>debug</param-name>
                         <param-value>false</param-value>调试时设为true
                 </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>
将在FCKeditor/editor/下创建Image和Flash文件夹,用于存放上传文件
                         <param-value>/editor/</param-value>
                 </init-param>
                 <init-param>
                         <param-name>debug</param-name>
                         <param-value>true</param-value>调试时设为true
                 </init-param>
                 <init-param>
                         <param-name>enabled</param-name>
                         <param-value>true</param-value>修改成true
                 </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</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>
和fckconfig.js的ImageBrowserURL等对应
                 <url-pattern>/editor/filemanager/browser/default/connectors/jsp/connector</url-pattern>
         </servlet-mapping>

         <servlet-mapping>
                 <servlet-name>SimpleUploader</servlet-name>
这里你可以按自己应用具体配置,需要和fckconfig.js的ImageUploadUrl等对应
                 <url-pattern>/editor/upload.do</url-pattern>
         </servlet-mapping>
</web-app>

分享到:
评论

相关推荐

    fck文档+jar包

    - **API参考**:详细解释了编辑器的各种方法、事件和属性,开发者可以根据需求进行调用和自定义。 - **示例代码**:提供了各种实际应用场景的代码片段,帮助开发者快速理解并实现特定功能。 - **故障排除**:常见...

    FCK在线文本编辑器的用法

    FCKEditor有三种调用方式: 1. **JS脚本调用**:通过JavaScript直接引用编辑器的JavaScript文件来创建编辑区域。 2. **自定义标签**:在HTML中使用自定义标签来嵌入编辑器,例如`&lt;fckeditor&gt;`。 3. **FCKeditor API...

    FCK富文本编辑器

    **FCK富文本编辑器详解** FCKeditor是一款开源的JavaScript富文本编辑器,它为网页开发者提供了一种在浏览器端进行文字编辑、格式化和插入多媒体内容的强大工具。FCKeditor的名字来源于其创始人Fernando Monteiro的...

    Fck编辑器基本使用.doc

    此文件定义了编辑器的自定义标签库,使得在JSP页面中可以直接调用编辑器组件。 ##### 步骤4:配置Web.xml文件 - 将示例中的配置内容添加到项目中的`web.xml`文件中,并根据实际情况调整Servlet的路径配置。这一步是...

    FCK jsp应用实例

    **FCK编辑器在JSP中的应用实例** FCKeditor是一款知名的开源富文本编辑器,它为网页开发者提供了在浏览器端进行文字编辑的功能,支持多种格式的文本、图像、链接等元素的插入与编辑。本实例主要探讨如何将FCKeditor...

    FCK整合JSP 简化之后的

    在“FCK整合JSP 简化之后的”项目中,开发者可能已经完成了上述步骤,并优化了整合过程,使得用户可以直接运行而无需进行复杂的配置。这通常意味着所有必要的文件都已经包含在内,例如配置文件、样式表和必需的...

    FCK 使用指南.doc

    FCKeditor由Frederico Caldeira Knabben开发,其名称中的“FCK”正是开发者名字的首字母缩写。这款编辑器支持多种编程语言,包括但不限于PHP、JavaScript、ASP、ASP.NET、ColdFusion、Java和ABAP。这意味着开发者...

    FCK在线编译器JSP自定义函数Proxool连接池配置信息.

    `JSP(JavaServer Pages)`作为服务器端脚本语言,常用于构建动态网站。而`Proxool`是一种轻量级的数据库连接池,它可以提高数据库连接的复用性,降低系统资源消耗,从而提升应用性能。接下来,我们将深入探讨这三个...

    java fckeditor所需jar包

    - **下载库文件**:压缩包中的"java-fck"文件包含了FCKeditor的Java接口和必要的JavaScript资源。 - **导入jar包**:你需要将这些jar文件添加到项目的类路径中,通常包括fckeditor.jar和可能的依赖库,以便在...

    fckedit编辑器

    三种方法调用FCKeditor 1.FCKeditor自定义标签 (必须加头文件 &lt;%@ taglib uri="/TestFCKeditor" prefix="FCK" %&gt; ) 2.script脚本语言调用 (必须引用 脚本文件 ...

    FCKeditor教程

    3. **配置Web.xml**:将`fckjava/web/WEB-INF/web.xml`中的两个`servlet`和`servlet-mapping`配置复制到你的应用的`web.xml`文件中。这一步是为了让Tomcat或其他Servlet容器能够识别并处理FCKeditor的相关请求。 4....

    FCKeditor_for_Java

    接下来解压`FCKeditor-2.3.zip`文件,这是用于Java服务器页面(JSP)的整合包,其主要目的是简化在JSP中使用FCKeditor的过程,避免了复杂的JavaScript插件或API使用方法。 ##### 3.3 修改`web.xml` 将`FCKeditor-2.3...

    FCKeditor 使用笔记

    FCKeditor 在JSP中的调用主要分为两种方式: ##### 方法一:直接实例化FCKeditor对象 1. **导入JS文件**:首先需要在页面头部导入FCKeditor的核心JS文件。 ```html ...

    FCKeditor配置for java

    然后通过JavaScript调用`FCKeditor.Replace()`方法来初始化编辑器: ```html &lt;textarea id="myEditor" name="myEditor"&gt;&lt;/textarea&gt; window.onload = function() { var oFCKeditor = new FCKeditor( 'myEditor' ) ...

    关于JAVA文件编辑器的使用

    最后,通过调用CKEditor.create()方法,就可以在页面上创建一个富文本编辑器实例。 CK编辑器还提供了一套丰富的API,允许开发者在运行时动态控制编辑器的行为,如获取或设置编辑器的内容、监听编辑事件、插入和删除...

    FCKeditor (jsp在线编辑器)配置总结

    - 另一种方法是通过`iframe`方式添加编辑器: ```jsp ;Toolbar=Default"&gt; ``` #### 四、测试与验证 1. **创建测试页面**: - 创建一个新的JSP页面,例如`test.jsp`。 - 在该页面中引入标签库并创建编辑器...

    FCKeditor使用指南

    - **方法三:适合于Ajax的调用方法** 对于使用Ajax的动态页面,可以通过这种方式动态创建FCKeditor实例。 ```javascript var oFCKeditor = new FCKeditor('editor1') ; oFCKeditor.BasePath = '/path/to/...

    FCKeditor_for_Java_使用详解

    假设我们将FCKeditor及其调用脚本放置在同一目录内。 2. **安装FCKeditor核心文件**:解压`FCKeditor_2.2.zip`文件,将其中的`FCKeditor`目录复制到网站的根目录下。 3. **安装JSP整合包**:解压`FCKeditor-2.3....

    web编辑器fckeditor ,JSP里使用

    ### 三、FCKeditor的使用方法 1. **基本使用**:在JSP中,通过JavaScript函数`FCKeditor()`创建一个编辑器实例,如`var oFCKeditor = new FCKeditor('editor')`,其中'editor'是HTML元素的ID。 2. **初始化编辑器*...

Global site tag (gtag.js) - Google Analytics