index.jsp:
<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.fckeditor.net" prefix="FCK" %>
<html>
<head>
<title>FckEditor测试</title>
</head>
<body style="text-align: center;">
<div style="text-align: center;width: 600pt">
<h2>FckEditor测试</h2>
<hr>
<form action="ShowData.jsp" method="post">
<FCK:editor instanceName="test" height="400pt">
<jsp:attribute name="value"> 这里是<a href="http://hi.baidu.com/huqiwen">数据测试</a>
</jsp:attribute>
</FCK:editor>
<input type="submit" value="提交"/>
<input type="reset" value="重置"/>
</form>
</div>
</body>
</html>
ShowData.jsp:
<%@ page language="java" contentType="text/html; charset=UTF-8"
pageEncoding="UTF-8"%>
<head>
<title>FCKeditor - 显示数据</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
</head>
<%
request.setCharacterEncoding("UTF-8");
String data = request.getParameter("test");
%>
<body>
<h1>FCKeditor - 显示数据</h1>
<hr/><br />
<%=data%>
</body>
</html>
web.xml:
<?xml version="1.0" encoding="UTF-8"?>
<web-app version="2.4" id="fckeditor-java" xmlns="http://java.sun.com/xml/ns/j2ee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd"
>
<display-name>FCKeditor.Java Sample Web Application</display-name>
<description>FCKeditor.Java Sample Web Application</description>
<servlet>
<servlet-name>Connector</servlet-name>
<servlet-class>
net.fckeditor.connector.ConnectorServlet
</servlet-class>
<load-on-startup>1</load-on-startup>
</servlet>
<servlet-mapping>
<servlet-name>Connector</servlet-name>
<url-pattern>
/fckeditor/editor/filemanager/connectors/*
</url-pattern>
</servlet-mapping>
</web-app>