正在进行安全检测...

发布时间:1714403975   来源:文档文库   
字号:
FCK编辑器在JSP中使用说明
步骤1:将fckeditor文件夹拷贝到/WebRoot目录下
步骤2:将lib文件夹下的两个jar文件拷贝到/WebRoot/WEB-INF/lib目录下 步骤3:将FCKeditor.tld文件拷贝到/WebRoot/WEB-INF目录下
步骤4:将Web.xml文件中的内容拷贝到工程的web.xml文件中,注意里面两个Servlet置的路径修改

JSP页面配置FCKeditor编辑器

方法一
JSP页面头部配置
<%@ page language="java" import="com.fredck.FCKeditor.*"%> 标签你想放置FCKeditor编辑器的地方配置
<% // 获得上下文路径
String path = request.getContextPath(; FCKeditor oFCKeditor; // 定义一个属性来使Action通过request来获得FCKeditor编辑器中的值 oFCKeditor = new FCKeditor(request, "content"; oFCKeditor.setBasePath(path + "/fckeditor/"; // 设置FCKeditor编辑器打开时的默认值 oFCKeditor.setValue("input 1111"; out.println(oFCKeditor.create(; %>

方法二
JSP页面头部配置
<%@ taglib uri="/MyFCKeditor" prefix="FCK"%> 注意这个uri,也可以写为"/WEB-INF/FCKeditor.tld",这里的写法其实是已经将tld文件配置在工程的web.xml文件中了
标签你想放置FCKeditor编辑器的地方配置
定义FCKeditor的标志,以便Action获得其值--> basePath="fckeditor/" imageBrowserURL="/fckeditor/editor/filemanager/browser/default/browser.html?Type=Image&Connector=connectors/jsp/connector" linkBrowserURL="/fckeditor/editor/filemanager/browser/default/browser.html?Connector=connectors/jsp/connector" flashBrowserURL="/fckeditor/editor/filemanager/browser/default/browser.html?Type=Flash&Connector=connectors/jsp/connector"> this is default content :

QAction中如何获得FCKeditor中的内容?
AFCKeditorcontentActionrequest.getParameter("content"即可。注意的是,这里获得的字符串是包括html标签的(即FCKeditor的值的HTML源代码) QFCKeditor中的按钮太多,只要其中一些该如何修改? A:在fckconfig.js文件中修改,代码如下:
FCKConfig.ToolbarSets["Default"] = [

[''Cut'',''Copy'',''Paste'',''PasteText'',''PasteWord'',''-'',''Print'',''SpellCheck''], [''Undo'',''Redo'',''-'',''Find'',''Replace'',''-'',''SelectAll'',''RemoveFormat''], [''Bold'',''Italic'',''Underline'',''StrikeThrough'',''-'',''Subscript'',''Superscript''], [''OrderedList'',''UnorderedList'',''-'',''Outdent'',''Indent''], [''JustifyLeft'',''JustifyCenter'',''JustifyRight'',''JustifyFull''], [''Link'',''Unlink'',''Anchor'',''Image'',''Flash''], [''TextColor'',''BGColor'',''Table'',''Rule''],

[''Style'',''FontFormat'',''FontName'',''FontSize''] ] ;

将不用的删除即可。
QFCKedior中如何使用JavaScript来获得和设置其中的内容 A

本文来源:https://www.2haoxitong.net/k/doc/4fb4433d90c69ec3d5bb7547.html

《正在进行安全检测....doc》
将本文的Word文档下载到电脑,方便收藏和打印
推荐度:
点击下载文档

文档为doc格式

相关推荐