<%@ page language="java" contentType="text/html; charset=UTF-8"
pageEncoding="UTF-8"%>
<%@ page trimDirectiveWhitespaces="true"%> <!-- jsp输出的html时去除多余的空行(jsp上使用EL和tag会产生大量的空格和空行)。 -->
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort()
+ path + "/";
%>
<!DOCTYPE html>
<html lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta name="keywords" content="jquery,ui,easy,easyui,web">
<meta name="description" content="easyui help you build your web page easily!">
<title>jQuery EasyUI Demo</title>
<link rel="stylesheet" type="text/css" href="<%=basePath%>/css/easyui/default/easyui.css">
<link rel="stylesheet" type="text/css" href="<%=basePath%>/css/jeasyui/icon.css">
<script type="text/javascript" src="<%=basePath%>/js/jquery-1.4.4.min.js"></script>
<script type="text/javascript" src="<%=basePath%>/js/jquery.easyui.min.js"></script>
<link rel="stylesheet" href="<%=path%>/kindeditor/themes/default/default.css" />
<link rel="stylesheet" href="<%=path%>/kindeditor/plugins/code/prettify.css" />
<script charset="utf-8" src="<%=path%>/kindeditor/kindeditor.js"></script>
<script charset="utf-8" src="<%=path%>/kindeditor/lang/zh_CN.js"></script>
<script charset="utf-8" src="<%=path%>/kindeditor/plugins/code/prettify.js"></script>
<script type="text/javascript">
KindEditor.ready(function(K) {
window.editor = K.create('#editor_id');
});
var editor1;
KindEditor.ready(function(K) {
editor1 = K.create('textarea[name="content"]', {
cssPath : '<%=path%>/kindeditor/plugins/code/prettify.css',
uploadJson : '<%=path%>/kindeditor/jsp/upload_json.jsp',//标识处理图片的文件
fileManagerJson : '<%=path%>/kindeditor/jsp/file_manager_json.jsp',
allowFileManager : true,//允许上传文件和图片
afterCreate : function() {
this.sync();
},
afterBlur:function(){
this.sync();
}
});
prettyPrint();
});
</script>
</head>
<body>
<form method="post" action="richText/saveKEditor">
<label>标题:</label>
<div class="content">
<textarea name="content" id="content"
style="width:500px;height:300px;">在这里输入内容...</textarea>
</div>
<div class="btn">
<input type="submit" value="确定" name="submit" /> <input type="reset"
value="重置" name="reset" />
</div>
</form>
</body>
</html>
@RequestMapping("richText")
public class RichTixetController {
@RequestMapping("/saveKEditor")
public String save(String content,ModelMap map){
String msg="上传成功!";
//保存标签
String url="";
map.addAttribute("msg", msg);
url=content;
map.addAttribute("content", content);
System.out.println("richText saving..."+content.toString().trim());
return "ok";
}
}