FCKeditor2.6 For Java
关键字: fck jsp1、首先登陆www.fckeditor.net/download下载FCKeditor的最新版本,需要下载2个压缩包,一个是基本应用,另一个是在为在jsp下所准备的配置。
FCKeditor 2.6 下载地址:sourceforge.net/project/downloading.php
FCKeditor.Java 下载地址:sourceforge.net/project/downloading.php
下载之后分别为:FCKeditor_2.6.zip 和 FCKeditor-2.3.zip 将它们分别解压。
2、首先在Eclipse下建立一个新项目例如:test 即http://localhost:8080/test
在项目中新建文件夹 FCKeditor,然后将解压后的FCKeditor_2.6下fckeditor里面的editor、fckconfig.js、fckeditor.js、fckstyles.xml、fcktemplates.xml拷贝到FCKeditor目录下
将解压后的FCKeditor-2.3文件夹中web/WEB-INF/lib下的包拷贝到test项目的lib中。
将FCKeditor-2.3文件夹下src下的FCKeditor.tld拷贝到test项目的WEB-INF下。
3、修改WEB-INF下的web.xml, 如下:
4、修改FCKeditor文件夹下的fckeditor.js
修改第50行的FCKeditor.BasePath。
改之后:
5、修改FCKeditor文件夹下的fckconfig.js
修改FCKConfig.DefaultLanguage、FCKConfig.LinkBrowserURL、FCKConfig.ImageBrowserURL、FCKConfig.FlashBrowserURL、
改之后:
6、default.jsp内容如下:
<%@ page contentType="text/html; charset=gb2312" language="java" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>FCKeditor测试</title>
<script type="text/javascript" src="FCKeditor/fckeditor.js"></script>
</head>
<body>
<form id="form1" name="form1" method="post" action="default_do.jsp">
<table width="100%" border="0">
<tr>
<td height="25">
<textarea name="contest" id="contest" style="width:100%; height:400px;"></textarea>
<script type="text/javascript">
var oFCKeditor = new FCKeditor( 'contest' ) ;
//oFCKeditor.BasePath = 'FCKeditor/' ;
oFCKeditor.ToolbarSet = 'Default' ;
oFCKeditor.Width = '100%' ;
oFCKeditor.Height = '400' ;
oFCKeditor.Value = '' ;
oFCKeditor.ReplaceTextarea();
//oFCKeditor.Create() ;
</script>
<input type="submit" name="Submit" value="提交" />
</td>
</tr>
</table>
</form>
</body>
</html>
<%@ page contentType="text/html; charset=gb2312" language="java" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>FCKeditor测试接收结果</title>
</head>
<body>
<%
String contest = new String(request.getParameter("contest").getBytes("ISO8859_1"), "GB2312");
out.print(contest);
%>
</body>
</html>
7、default_do.jsp内容如下:
最后测试:http://localhost:8080/test/default.jsp
发表评论
- 浏览: 73568 次
- 性别:

- 来自: 西安

- 详细资料
搜索本博客
我的相册
共 7 张
链接
最新评论
-
TinyMCE3.0.8简体中文字体 ...
正找呢 太感谢了
-- by itshu -
Hibernate的<query>标签 ...
hibernate中有没有像ibatis中<select>标签中用于拼接查 ...
-- by kilavater -
TinyMCE3.0.8简体中文字体 ...
非常棒,谢谢楼主!
-- by rubyrock -
(转)广为流传的一个关于 ...
好长,不过有见地
-- by wenson -
闲言碎语
我觉的迷茫那个解释 解释的很好 呵呵
-- by zhangzhaofeng






评论排行榜