将form表单提交到Servlet中,处理以后,将结果返回给前台
index.jsp
<%@ page language="java" contentType="text/html; charset=UTF-8"
pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Insert title here</title>
<script type="text/javascript" src="ckeditor/ckeditor.js"></script>
<script type="text/javascript">
window.onload = function() {
CKEDITOR.replace('editor');
};
</script>
</head>
<body>
<form action="ShowServlet" method="post">
<textarea rows="" cols="" name="editor"></textarea>
<br /> <input type="submit" value="提交"><input type="reset">
</form>
</body>
</html>
show.jsp
<%@ page language="java" contentType="text/html; charset=UTF-8"
pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Insert title here</title>
</head>
<body>
${data }
</body>
</html>
ShowServlet.java
package servlet;
import java.io.IOException;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
public class ShowServlet extends HttpServlet {
private static final long serialVersionUID = 1L;
public ShowServlet() {
super();
}
protected void doGet(HttpServletRequest request,
HttpServletResponse response) throws ServletException, IOException {
}
protected void doPost(HttpServletRequest request,
HttpServletResponse response) throws ServletException, IOException {
request.setCharacterEncoding("UTF-8");
response.setCharacterEncoding("UTF-8");
String data = request.getParameter("editor");
request.setAttribute("data", data);
request.getRequestDispatcher("showServlet.jsp").forward(request,
response);
}
}
进行这样的设置以后,基本的功能就可以实现了
分享到:
相关推荐
<%@ Register Assembly="CKEditor.NET" Namespace="CKEditor.NET" TagPrefix="CKEditor" %>-------引进CKEditor控件 【图书特色】 <CKEditor:CKEditorControl ID="bookFeature" runat="server" ></CKEditor:...
CKEditor和CKFinder在ASP.NET的应用和演示文档。 CKEditor和CKFinder在ASP.NET项目中安装,配置和使用详解。 http://write.blog.csdn.net/postedit/22868963
在asp中使用ckeditor开启图片上传功能的设置方法: 1、下载asp版本的ckfinder,放到ckeditor目录下 2、修改ckeditor\config.js,加上如下内容: CKEDITOR.editorConfig = function( config ) { config.scayt_...
截止2018年1月1号最新的ckeditor4源码,17.6M大小,非常值得研究和学习。特别是想扩展它的插件。
ckfinder ckeditor 文本编辑器 图片上传
把ckeditor 3.4的ckeditor.js复盖就行
最近项目开发需要用到CKEditor在线编辑器,但发现他本身没有自带,所以需要自己手动配置插件。但网上很多配置都有问题,自己摸索了好久终于搞定。需要注意的细节有:flvPlayer文件夹的内容直接放在ckeditor文件夹...
ckeditor
最多人使用的两种网页编辑器,CKEditor和KindEditor简明使用教程,一看包你会!!!
CKEditor实现本地视频和图片的上传功能,不用kfinal
ckeditor3.6详细的用法说明和配置.很好用!
在VS2008中整合ckeditor和ckfinder两者的完美结合,相信你可以用的舒服。
用webupload插件,自定义ckeditor按钮控件,实现文件上传功能,包括后台接口ashx文件。
java与ckeditor和ckfinder整合后实现上传图片功能
ckeditor 富文本控件代码以及使用说明
本插件源码来自互联网,由于源代码基于ckeditor3.6.61,故对源码进行过简单修改,以求适应ckeditor4.4.7
之前在网上下载的都不可以用,于是想尽办法发现是网上提供的是不支持最新的ckeditor.用法找见自己的ckeditor地址让后放到ckeditor...最后根据自己版本和需求在config.toolbar_Full(估计4.5之后是)里放入'lineheight'即可
适用于帝国后台的ckeditor的行间距行高lineheight插件,里面的内容已经修改好,解压后好即可使用。
ckeditor和ckfinder 文件包
这个ckeditor的version为4.6.1,。 主要是添加了拖拽上传图片个上传视频的功能, 具体教程看博文:http://blog.csdn.net/u014044812/article/details/53897024