用的是fckeditor
下载地址:http://ckeditor.com/
把下载的
jar包解压放入web-Root文件下
新建个jsp页面
导入fckeditor.js文件
<script type="text/javascript"
src="${pageContext.servletContext.contextPath }/fckeditor/fckeditor.js"></script>
在jsp页面的body中写入
<form action="get_FCK" method="post">
<script type="text/javascript">
var oFckeditor = new FCKeditor("content1");//传值的名字和表单text的name一样
oFckeditor.BasePath= "${pageContext.servletContext.contextPath }/fckeditor/";
oFckeditor.Width=800;
oFckeditor.Height=400;
oFckeditor.ToolbarSet="Default";
oFckeditor.Value="欢迎管理<b>NIIT</b>123";
oFckeditor.Create();
</script>
<br/>
<input type="submit" value="发帖">
</form>
在新建个servlet(url:get_FCK)用来处理用post提交上来的数据
public void doPost(HttpServletRequest request, HttpServletResponse response)
throws ServletException, IOException
{
request.setCharacterEncoding("UTF-8");
String str = request.getParameter("content1");
response.setContentType("text/html;charset=utf-8");
PrintWriter out = response.getWriter();
out.println("<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\">");
out.println("<HTML>");
out.println(" <HEAD><TITLE>A Servlet</TITLE></HEAD>");
out.println(" <BODY>");
out.print(str);
out.println(", using the POST method");
out.println(" </BODY>");
out.println("</HTML>");
out.flush();
out.close();
}
第一次做的不知道什么原因上传图片或者文件不行……
分享到:
相关推荐
FCKeditor 文本编辑器 编程 网站 计算机
在SSH项目中整合FCKeditor文本编辑器技术
FCKeditor文本编辑器,不错的东东
功能强大的FCKEditor文本编辑器最新版下载 demo示例 在Asp.Net下配置环境说明
fckeditor文本编辑器代码详解......
里面有所需的包,最重要的有介绍fckeditor的视频资料,保证满足你的要求...
有代码高亮的fckeditor文本编辑器(php版)
强大的fckeditor文本编辑器,只要配置就可以实现上传功能,解决文本编辑上传处理和其他一些麻烦的问题!
FCKeditor文本编辑器插件的使用,包含FCKeditor使用方法详解.doc文档、FCKeditor使用步骤.txt的总结、struts2整合FCK时报302错误.txt的总结文档,对你非常有帮助。
fckeidorfckeidorfckeidorfckeidorfckeidorfckeidor
里面包含FCKeditor插件以及详细的使用插件,保证你一看就会,非常好的一个东西。
FCKeditor是目前最优秀的可见即可得网页编辑器之一,它采用JavaScript编写。具备功能强大、配置容易、跨浏览器、支持多种编程语言、开源等特点。它非常流行,互联网上很容易找到相关技术文档,国内许多WEB项目和大型...
精简版 FCKEditor 在线文本编辑器,去除了原来过多的文本,精简后更加小巧易用.
工程目录下FCKeditor/FCKeditor-v2.6.3/fckeditor/_samples/default.html文件是我根据自己的理解对它的文档进行修改的测试程序,所以只能作为参考,未必正确