1. 使用FCKeditor自定义标签
<%@ page contentType="text/html;charset=UTF-8" language="java"%>
<%@ taglib uri="/WEB-INF/FCKeditor.tld " prefix="fck"%>
<html>
<head>
<title>Test</title>
</head>
<body>
<!-- 标签调用方式 -->
<FORM action="show.jsp">
<fck:editor id="content" basePath="/test/fckeditor/" height="400"
width="800" skinPath="/test/fckeditor/editor/skins/default/"
toolbarSet="Default"
imageBrowserURL="/test/fckeditor/editor/filemanager/browser/default/browser.html?Type=Image&Connector=connectors/jsp/connector"
linkBrowserURL="/test/fckeditor/editor/filemanager/browser/default/browser.html?Connector=connectors/jsp/connector"
flashBrowserURL="/test/fckeditor/editor/filemanager/browser/default/browser.html?Type=Flash&Connector=connectors/jsp/connector"
imageUploadURL="/test/fckeditor/editor/filemanager/upload/simpleuploader?Type=Image"
linkUploadURL="/test/fckeditor/editor/filemanager/upload/simpleuploader?Type=File"
flashUploadURL="/test/fckeditor/editor/filemanager/upload/simpleuploader?Type=Flash">
</fck:editor>
<input type="submit" value="提交">
</FORM>
</body>
</html>
2. 用Javascript脚本语言调用
<%@ page contentType="text/html;charset=UTF-8" language="java"%>
<html>
<head>
<title>Test</title>
<script type="text/javascript" src="/test/fckeditor/fckeditor.js"></script>
</head>
<body>
<form action="show.jsp" method="get">
<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 = "/test/fckeditor/" ;
oFCKeditor.Height = 400;
oFCKeditor.ToolbarSet = "Default" ;
oFCKeditor.ReplaceTextarea();
</script>
<input type="submit" value="Submit">
</td>
</tr>
</table>
</form>
</body>
</html>
3. FCKeditor API 调用
<%@ page contentType="text/html;charset=UTF-8" language="java"%>
<%@ page language="java" import="com.fredck.FCKeditor.*" %>
<html>
<head>
<title>Test</title>
</head>
<body>
<form action="show.jsp" method="post">
<%
FCKeditor oFCKeditor ;
oFCKeditor = new FCKeditor( request, "content" ) ;
oFCKeditor.setBasePath( "/test/fckeditor/" ) ;
oFCKeditor.setValue( "input" );
oFCKeditor.setWidth("800");
out.println(oFCKeditor.create()) ;
%>
<br>
<input type="submit" value="Submit">
</form>
</body>
</html>
测试页面:show.jsp
<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>My JSP 'test.jsp' starting page</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>
<%=new String(request.getParameter("content").getBytes("iso-8859-1"),"UTF-8")%>
</body>
</html>