国产一级a片免费看高清,亚洲熟女中文字幕在线视频,黄三级高清在线播放,免费黄色视频在线看

打開(kāi)APP
userphoto
未登錄

開(kāi)通VIP,暢享免費(fèi)電子書(shū)等14項(xiàng)超值服

開(kāi)通VIP
FCKEditor使用說(shuō)明

1. FCKeditor 介紹
FCKeditor 這個(gè)開(kāi)源的HTML 文本編輯器可以讓web 程序擁有如MS Word 這樣強(qiáng)大的編輯功
能.FCKeditor 支持當(dāng)前流行的瀏覽器如IE 5.5+, Firefox 1.0+, Mozilla 1.3+與Netscape 7+等。

FCKeditor官司方網(wǎng)址:http://www.fckeditor.net/

FCKeditor在線DEMOhttp://www.fckeditor.net/demo

FCKeditor下載直址:http://www.fckeditor.net/download (該版本為2.3.2),最新版已經(jīng)是2.4了。

2.FCKeditor.java介紹

不能直接在JSP項(xiàng)目中使用,需要FCKeditor.java庫(kù)的支持。

FCKeditor.java是針對(duì)對(duì)JAVA中使用FCKeditorSimone Chiaretta開(kāi)發(fā)的FCKeditorJAVA實(shí)現(xiàn)。

下載地址:http://www.fckeditor.net/download (最近版本為2.3)

 

3.JAVA項(xiàng)目中使用FCKeditor在線編輯器

開(kāi)發(fā)環(huán)境:JDK5.0 <!--[if !supportLists]--> Eclipse3.2.1 + WTP1.5.2

(1)新建一個(gè)WEB工程:


(2)解壓 FCKeditor_2.3.2.zip包,將其中的 edit 文件夾到項(xiàng)目中的 WebRoot 目錄

(3)解壓 FCKeditor_2.3.2.zip 包,將其中的 fckconfig.js、fckeditor.js、fckstyles.xml、fcktemplates.xml 文件夾到項(xiàng)目中的 WebRoot 目錄

(4)解壓 FCKeditor.java-2.3.zip 包,將其中的 \web\WEB-INF\lib 下的兩個(gè) jar 文件到項(xiàng)目的 WebRoot\WEB-INF\lib 目錄

(5)解壓 FCKeditor.java-2.3.zip 包,將其中的 \src 下的 FCKeditor.tld 文件到項(xiàng)目的 WebContent\WEB-INF 目錄

(6)刪除 WebContent\edit 目錄下的 _source 文件夾(以“_”開(kāi)始的文件,在項(xiàng)目中無(wú)用)

完成后的目錄結(jié)構(gòu)下如:

說(shuō)明:圖中的input.jsp和display.jsp兩個(gè)是我寫(xiě)的測(cè)試集成FCKeditor的JSP文件。

  • 修改WebContent/WEB-INF/web.xml文件,加入FCKeditor的配置信息,如下:
xml 代碼
 
  1. xml version="1.0" encoding="UTF-8"?>  
  2. <web-app id="WebApp_ID" version="2.4"  
  3.     xmlns="http://java.sun.com/xml/ns/j2ee"  
  4.     xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"  
  5.     xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd">  
  6.     <display-name>FCKeditor<!--</span-->display-name>  
  7.     <servlet>  
  8.         <servlet-name>Connector<!--</span-->servlet-name>  
  9.         <servlet-class>  
  10.             com.fredck.FCKeditor.connector.ConnectorServlet  
  11.         <!--</span-->servlet-class>  
  12.         <init-param>  
  13.             <param-name>baseDir<!--</span-->param-name>  
  14.             <!-- 此為文件瀏覽路徑 -->  
  15.             <param-value>/UserFiles/<!--</span-->param-value>  
  16.         <!--</span-->init-param>  
  17.         <init-param>  
  18.             <param-name>debug<!--</span-->param-name>  
  19.             <param-value>true<!--</span-->param-value>  
  20.         <!--</span-->init-param>  
  21.         <load-on-startup>1<!--</span-->load-on-startup>  
  22.     <!--</span-->servlet>  
  23.     <servlet>  
  24.         <servlet-name>SimpleUploader<!--</span-->servlet-name>  
  25.         <servlet-class>  
  26.             com.fredck.FCKeditor.uploader.SimpleUploaderServlet  
  27.         <!--</span-->servlet-class>  
  28.         <init-param>  
  29.             <param-name>baseDir<!--</span-->param-name>  
  30.             <!-- 此為文件上傳路徑,需要在WebRoot 目錄下新建 UserFiles 文件夾 -->  
  31.             <!-- 根據(jù)文件的類型還需要新建相關(guān)的文件夾 Image、Flash -->  
  32.             <param-value>/UserFiles/<!--</span-->param-value>  
  33.         <!--</span-->init-param>  
  34.         <init-param>  
  35.             <param-name>debug<!--</span-->param-name>  
  36.             <param-value>true<!--</span-->param-value>  
  37.         <!--</span-->init-param>  
  38.         <init-param>  
  39.             <!-- 此參數(shù)為是否開(kāi)啟上傳功能 -->  
  40.             <param-name>enabled<!--</span-->param-name>  
  41.             <param-value>false<!--</span-->param-value>  
  42.         <!--</span-->init-param>  
  43.         <init-param>  
  44.             <param-name>AllowedExtensionsFile<!--</span-->param-name>  
  45.             <param-value><!--</span-->param-value>  
  46.         <!--</span-->init-param>  
  47.         <init-param>  
  48.             <!-- 此參數(shù)為文件過(guò)濾,以下的文件類型都不可以上傳 -->  
  49.             <param-name>DeniedExtensionsFile<!--</span-->param-name>  
  50.             <param-value>  
  51.                 php|php3|php5|phtml|asp|aspx|ascx|jsp|cfm|cfc|pl|bat|exe|dll|reg|cgi  
  52.             <!--</span-->param-value>  
  53.         <!--</span-->init-param>  
  54.         <init-param>  
  55.             <param-name>AllowedExtensionsImage<!--</span-->param-name>  
  56.             <param-value>jpg|gif|jpeg|png|bmp<!--</span-->param-value>  
  57.         <!--</span-->init-param>  
  58.         <init-param>  
  59.             <param-name>DeniedExtensionsImage<!--</span-->param-name>  
  60.             <param-value><!--</span-->param-value>  
  61.         <!--</span-->init-param>  
  62.         <init-param>  
  63.             <param-name>AllowedExtensionsFlash<!--</span-->param-name>  
  64.             <param-value>swf|fla<!--</span-->param-value>  
  65.         <!--</span-->init-param>  
  66.         <init-param>  
  67.             <param-name>DeniedExtensionsFlash<!--</span-->param-name>  
  68.             <param-value><!--</span-->param-value>  
  69.         <!--</span-->init-param>  
  70.         <load-on-startup>1<!--</span-->load-on-startup>  
  71.     <!--</span-->servlet>  
  72.     <servlet-mapping>  
  73.         <servlet-name>Connector<!--</span-->servlet-name>  
  74.         <url-pattern>  
  75.             /editor/filemanager/browser/default/connectors/jsp/connector  
  76.         <!--</span-->url-pattern>  
  77.     <!--</span-->servlet-mapping>  
  78.     <servlet-mapping>  
  79.         <servlet-name>SimpleUploader<!--</span-->servlet-name>  
  80.         <url-pattern>  
  81.             /editor/filemanager/upload/simpleuploader  
  82.         <!--</span-->url-pattern>  
  83.     <!--</span-->servlet-mapping>  
  84. <!--</span-->web-app>  

注:web.xml中已經(jīng)加入了一些常用配置的說(shuō)明。

  • 新建input.jsp文件,內(nèi)容如下:(注意內(nèi)容中的 testfck這個(gè)id)


(上面不能直接帖HTML的代碼,所以只能帖一個(gè)圖片上來(lái),要是有知道如何帖HTML代碼的朋友,請(qǐng)告訴我一下,謝謝)

說(shuō)明:在JSP中集成FCKeditor <!--[endif]-->JavaScript集成:

如上面內(nèi)容所示,通過(guò)新建一個(gè)FCKeditor對(duì)象,然后調(diào)用該對(duì)象的設(shè)置方法來(lái)設(shè)置FCKeditor的各個(gè)屬性,最后調(diào)用FCKeditorReplaceTextarea()替換HTML頁(yè)面中的<textarea>標(biāo)簽。另外FCKeditor也可以調(diào)用它的create()方法來(lái)直接在JSP嵌入FCKeditor編輯器。

注:注意上面的oFCKeditor.BasePath = "";用這種方式FCKeditor會(huì)去查找它的editor目錄下的fckeditor.html文件,由于我是直接將editor文件夾拷貝到WebContent目錄下,所以將它的BasePath設(shè)置為””,如果您將editor拷貝到其它目錄,請(qǐng)?jiān)O(shè)置相應(yīng)的BasePath屬性。FCKeditor默認(rèn)是將其放在fckeditor目錄

(2) <!--[endif]-->使用自定義標(biāo)簽該方法一定要完成第步:解壓 FCKeditor.java-2.3.zip 包,將其中的 \src 下的 FCKeditor.tld 文件到項(xiàng)目的 WebContent\WEB-INF 目錄

首先在JSP中加入FCKeditor標(biāo)簽:

<%@ taglib uri=”/WEB-INF/FCKeditor.tld” prefix=”fck” %>

       JSP頁(yè)面中加入如下代碼,集成FCKeditor編輯器:
js 代碼
  1.     id="testfck" <!--—注意這里 -->  
  2.     basePath="/FCKeditor/"   
  3.     height="60%"  
  4.     skinPath="/FCKeditor/editor/skins/default/"   
  5.     toolbarSet="Default"  
  6.     imageBrowserURL="/FCKeditor/editor/filemanager/browser/default/browser.html?Type=Image&Connector=connectors/jsp/connector"  
  7.     linkBrowserURL="/FCKeditor/editor/filemanager/browser/default/browser.html?Connector=connectors/jsp/connector"  
  8.     flashBrowserURL="/FCKeditor/editor/filemanager/browser/default/browser.html?Type=Flash&Connector=connectors/jsp/connector"  
  9.     imageUploadURL="/FCKeditor/editor/filemanager/upload/simpleuploader?Type=Image"  
  10.     linkUploadURL="/FCKeditor/editor/filemanager/upload/simpleuploader?Type=File"  
  11.     flashUploadURL="/FCKeditor/editor/filemanager/upload/simpleuploader?Type=Flash">  
  12.   

(10) 新建文件,這個(gè)文件比較簡(jiǎn)單,只是簡(jiǎn)單的顯示從在線編輯器傳遞過(guò)來(lái)的內(nèi)容,如下:

<%=request.getParameter("testfck")%>

注意這里的getParameter(“testfck”),這個(gè)”testfck”就是在input.jsp中設(shè)置的id。

4.FCKeditor類說(shuō)明

下面是用來(lái)在頁(yè)面中建立編輯器的FCKEDITOR 類的說(shuō)明

(1) 構(gòu)造器:

FCKeditor(instanceName[,width,height,toolbarSet,value])


  • instanceName:編輯器的唯一名稱(相當(dāng)于ID)

  • WIDTH:寬度

  • HEIGHT:高度

  • toolbarSet:工具條集合的名稱

  • value:編輯器初始化內(nèi)容


(2) 屬性:

  • instanceName:編輯器實(shí)例名

  • width:寬度,默認(rèn)值為100%

  • height:高度,默認(rèn)值是200

  • ToolbarSet:工具集名稱,參考FCKCONFIG.JS,默認(rèn)值是Default

  • value:初始化編輯器的HTML 代碼,默認(rèn)值為空

  • BasePath:編輯器的基路徑,默認(rèn)為/Fckeditor/文件夾,注意,盡量不要使用相對(duì)路徑.最用相對(duì)于站點(diǎn)根路徑的表示方法,要以/結(jié)尾

  • CheckBrowser:是否在顯示編輯器前檢查瀏覽器兼容性,默認(rèn)為true

  • DisplayErrors:是否顯示提示錯(cuò)誤,默為true

(3) 集合:

Config[Key]=value

這個(gè)集合用于更改配置中某一項(xiàng)的值,

oFckeditor.Config["DefaultLanguage"]="ptbr"

(4) 方法:

Create()

建立并輸出編輯器

RepaceTextArea(TextAreaName)

用編輯器來(lái)替換對(duì)應(yīng)的文本框

5.如何配置FCKEDITOR

FCKEDITOR 提供了一套用于定制其外觀,特性及行為的設(shè)置集.主配置文件名為Fckconfig.js你既可以編輯主配置文件,也可以自己定義單獨(dú)的配置文件.配置文件使用JAVASCRIPT 語(yǔ)法.修改后,在建立編輯器時(shí),可以使用以下語(yǔ)法:

varoFCKeditor=newFCKeditor('FCKeditor1')

oFCKeditor.Config['CustomConfigurationsPath']='/myconfig.js'

oFCKeditor.Create()

提醒:當(dāng)你修改配置后,請(qǐng)清空瀏覽器緩存以查看效果

配置選項(xiàng):

AutoDetectLanguage=true/false 自動(dòng)檢測(cè)語(yǔ)言

BaseHref=""相對(duì)鏈接的基地址

ContentLangDirection="ltr/rtl"默認(rèn)文字方向

ContextMenu=字符串?dāng)?shù)組,右鍵菜單的內(nèi)容

CustomConfigurationsPath=""自定義配置文件路徑和名稱

Debug=true/false 是否開(kāi)啟調(diào)試功能,這樣,當(dāng)調(diào)用FCKDebug.Output()時(shí),會(huì)在調(diào)試窗中輸出內(nèi)容

DefaultLanguage=""缺省語(yǔ)言

EditorAreaCss=""編輯區(qū)的樣式表文件

EnableSourceXHTML=true/false TRUE 時(shí),當(dāng)由可視化界面切換到代碼頁(yè)時(shí),HTML 處理成XHTML

EnableXHTML=true/false 是否允許使用XHTML 取代HTML

FillEmptyBlocks=true/false 使用這個(gè)功能,可以將空的塊級(jí)元素用空格來(lái)替代

FontColors=""設(shè)置顯示顏色拾取器時(shí)文字顏色列表

FontFormats=""設(shè)置顯示在文字格式列表中的命名

FontNames=""字體列表中的字體名

FontSizes=""字體大小中的字號(hào)列表

ForcePasteAsPlainText=true/false 強(qiáng)制粘貼為純文本

ForceSimpleAmpersand=true/false

本站僅提供存儲(chǔ)服務(wù),所有內(nèi)容均由用戶發(fā)布,如發(fā)現(xiàn)有害或侵權(quán)內(nèi)容,請(qǐng)點(diǎn)擊舉報(bào)
打開(kāi)APP,閱讀全文并永久保存 查看更多類似文章
猜你喜歡
類似文章
ckeditor3.6.5+ckfinder2.0.2+jsp編輯器配置 支持服務(wù)器瀏覽/上傳圖片、Flash
在項(xiàng)目中整合FCKeditor
FCKEditor 在 jsp中的使用說(shuō)明
FCKeditor2.6 for JSP 配置方法
FCKeditor編輯器,建立文件夾 . 變 _ 突破方法
在JSP中應(yīng)用FCKeditor(2.1.1和FCKeditor.Java 2.3)
更多類似文章 >>
生活服務(wù)
分享 收藏 導(dǎo)長(zhǎng)圖 關(guān)注 下載文章
綁定賬號(hào)成功
后續(xù)可登錄賬號(hào)暢享VIP特權(quán)!
如果VIP功能使用有故障,
可點(diǎn)擊這里聯(lián)系客服!

聯(lián)系客服