天天看点

JAVA中的Fckeditor使用

1.棣栧厛鍒癶ttp://www.fckeditor.net/download涓嬭浇FCKeditor.zip鍜孎CKeditor.java.zip锛?

2.鏂板缓涓€涓猈eb宸ョ▼FCKeditorTest锛?

3.鍦‵CKeditorTest涓殑WebRoot涓嬮潰鏂板缓fck鐩綍锛堢敤鏉ヨFCKeditor鎵€闇€鐨勬枃浠讹級锛?

4.鏂囦欢鎷疯礉

聽聽聽聽 4.1鎷疯礉FCKeditor.zip鐩綍涓嬬殑fckconfig.js锛宖ckeditor.js锛宖ckstyles.xml锛宖cktemplates.xml鍥涗釜鏂囦欢鍒癴ck鐩綍涓嬶紱

聽聽聽聽 4.2鏁寸悊FCKeditor.zip鐩綍涓媏ditor

聽聽聽聽聽聽聽聽 4.2.1鍒犻櫎鐩綍/_source

聽聽聽聽聽聽聽聽 4.2.2鍒犻櫎/filemanager/browser/default/connectors/涓嬬殑鎵€鏈夋枃浠?聽聽聽聽聽聽聽聽 4.2.3鍒犻櫎/filemanager/upload/涓嬬殑鎵€鏈夋枃浠?聽聽聽聽聽聽聽聽 4.2.4鍒犻櫎/lang/涓嬬殑闄や簡en.js锛寊h.js锛寊h-cn.js鍥涗釜鏂囦欢鐨勬墍鏈夋枃浠?聽聽聽聽 4.3鎷疯礉鏁寸悊濂界殑editor鏁翠釜鐩綍鍒板伐绋嬬殑fck鐩綍涓?聽聽聽聽 4.4鎷疯礉FCKeditor.java.zip涓嬮潰鐨剋eb/WEB-INF/lib涓殑涓や釜jar鍖?commons-fileupload.jar锛孎CKeditor-2.3.jar)鍒癋CKeditorTest鐩綍涓嬬殑WebRoot/WEB-INF/lib涓?聽聽聽聽 4.5鎷疯礉FCKeditor.java.zip涓殑src/FCKeditor.tld鎷疯礉鍒板伐绋媁ebRoot/WEB-INF涓嬶紱

聽聽聽聽 4.6鎷疯礉FCKeditor.java.zip涓殑web/WEB-INF/web.xml瑕嗙洊鎺夊伐绋嬩腑鐨剋eb.xml锛?

5.淇敼鏂囦欢

聽聽聽聽 5.1淇敼fckconfig.js鏂囦欢涓嬬殑FCKConfig.DefaultLanguage ='zh'; (zh鏀寔绠€绻佷綋锛寊h-cn鍙敮鎸佺畝浣?

鍒颁互涓婁负姝紝閰嶇疆缁撴潫锛堜笉鍏佽涓婁紶鏂囦欢锛?

6.鍦ㄦ牴鐩綍鏂板缓椤甸潰First.jsp锛屽唴瀹瑰涓嬶細

聽聽聽聽 <%@ page contentType="text/html; charset=GBK"%>

聽聽聽聽 <%@ taglib uri="/WEB-INF/FCKeditor.tld" prefix="FCK"%>

聽聽聽聽 <form action="fckeditor.do" method="post" target="_blank">

聽聽聽聽聽聽聽聽 <FCK:editor id="content" basePath="fck/" width="700" height="500" skinPath="skins/office2003/" toolbarSet="Default">

聽聽聽聽聽聽聽聽聽聽聽聽 杩欓噷鏄粯璁ゅ€?聽聽聽聽聽聽聽聽 </FCK:editor>

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

聽聽聽聽 </form>

7.鏂板缓涓€瀵笰ction鍜孎orm锛岀敤浜庢帴鏀禙irst.jsp浼犱笂鏉ョ殑鍐呭锛?

8.娉ㄦ剰涓€鐐广€傚綋JSP浼犵粰JSP鏃?

聽聽聽聽 request.setCharacterEncoding("GBK");

聽聽聽聽 String content = request.getParameter("content");

聽聽聽聽 杩欐牱鍑烘潵鐨勬暟鎹兘鏄纭殑銆傝€屽綋JSP浼犵粰Action鐨勬椂鍊欙紝涓枃閮藉彉鎴愪贡鐮侊紝闇€瑕佸仛涓€涓繃婊ゅ櫒锛?

9.涓€浜涢敊璇殑瑙e喅鏂规硶

聽聽聽 9.1鎴戝湪fckconfig.js閲岄潰鍔犲叆涓€浜涘瓧浣擄紙瀹嬩綋;闅朵功锛夛紝浣嗘樉绀哄嚭鏉ョ殑鍗存槸涔辩爜

聽聽聽聽聽聽聽 瑙e喅鏂规硶锛氭妸fckconfig.js瀛樻垚utf-8鏍煎紡鍗冲彲瑙e喅锛?

聽聽聽 9.2濡傛灉瑕佷慨鏀笷CK鏄剧ず鍑烘潵鐨勬弿杩?瑕佹敼zh-cn閲岄潰鐨?涓嫳浜掕瘧鐨勫唴瀹?;