百度富文本编辑器

<!-- https://mvnrepository.com/artifact/com.baidu.ueditor/ueditor -->
        <dependency>
            <groupId>com.baidu</groupId>
            <artifactId>ueditor</artifactId>
            <version>1.1.2</version>
        </dependency>
<script id="container" type="text/plain" style="width:100%;height:600px;"></script>
<script type="text/javascript">
//初始化
var ue = UE.getEditor('container', {
    autoHeightEnabled: false,
    //图表多行显示 对应参考http://fex.baidu.com/ueditor/#start-toolbar
//     toolbars: [
//         [
//             'anchor', 'undo',  'redo', 'bold', 'indent','snapscreen','italic', 'underline', 'strikethrough',  'subscript', 'fontborder','superscript','formatmatch', 'source', 'blockquote', 'pasteplain', 'selectall','print', 'mergedown',  'deleterow', 'deletecol',
//         ],
//         [
//             'splittorows','splittocols','splittocells','deletecaption', 'inserttitle', 'mergecells','deletetable', 'cleardoc','insertparagraphbeforetable', 'insertcode', 'fontfamily',  'fontsize',  'paragraph','simpleupload','insertimage','edittable',  'edittd','link','emotion','spechars','searchreplace','map', 'gmap', 'insertvideo',  'help',  'justifyleft','justifyright', 'justifycenter', 'justifyjustify',  'forecolor','backcolor', 
//         ],
//         [
//             'insertorderedlist', 'insertunorderedlist','fullscreen','directionalityltr','directionalityrtl','rowspacingtop', 'rowspacingbottom', 'pagebreak', 'insertframe', 'imagenone', 'imageleft',  'imageright','attachment', 'imagecenter','wordimage', 'lineheight','edittip ',  'customstyle','autotypeset','webapp','touppercase', 'tolowercase','background','template','scrawl','music', 'inserttable','drafts',  'charts', // 图表
//         ]
//     ]
});

// var ue = UE.getContent();
// //对编辑器的操作最好在编辑器ready之后再做
// ue.ready(function() {
//     //设置编辑器的内容
//     ue.setContent('hello');
//     //获取html内容,返回: <p>hello</p>
//     var html = ue.getContent();
//     console.log(html)
//     //获取纯文本内容,返回: hello
//     var txt = ue.getContentTxt();
// });
</script>
后台获取内容直接用editorValue接受
public String save(String editorValue) {}

注意:出版本为jsp版本

 

posted @ 2021-04-29 16:30  陳丶  阅读(122)  评论(0编辑  收藏  举报