zoukankan      html  css  js  c++  java
  • 使用ueditor jsp方式

    下载地址:https://github.com/fex-team/ueditor/releases/tag/v1.4.3.3

    应用服务器使用:weblogic

    源码下载后,将ueditor相关文件放置到Web目录

    (1)修改ueditor.config.js配置文件

    增加以下配置:

    window.UEDITOR_HOME_URL = "/ueditor_test/ueditor/";

    修改服务器统一请求接口路径:

    serverUrl: URL + "jsp/controller.jsp"

    (2)修改config.json配置文件

    "imageUrlPrefix": "/ueditor_test"

    (3)修改controller.jsp中的rootPath

    String rootPath = this.getServletConfig().getServletContext().getResource("/").getPath();

    (4)新建index.jsp测试界面

    <%@page contentType="text/html" pageEncoding="GBK"%>
    <!DOCTYPE html>
    <html>
        <head>
            <meta http-equiv="Content-Type" content="text/html; charset=GBK">
            <title>JSP Page</title>
    
            <script type="text/javascript" charset="utf-8" src="ueditor/ueditor.config.js"></script> <!--ueditor的配置文件-->
            <script type="text/javascript" charset="utf-8" src="ueditor/editor_api.js"></script> <!--ueditor核心文件-->
            <script type="text/javascript" charset="utf-8" src="ueditor/lang/zh-cn/zh-cn.js"></script> <!--ueditor语言文件-->
    
            <style type="text/css">
                div{
                    width:100%;
                }
            </style>
        </head>
        <body>
            <div>
                <script id="editor" type="text/plain" style="800px;height:300px;"></script>
            </div>
    
            <div>
                <button onclick="getContent()">获得内容</button>
            </div>
    
            <script type="text/javascript">
                var ue = UE.getEditor('editor');
    
                function getContent() {
    
                    var content = UE.getEditor('editor').getContent();
    
                    alert(content);
                }
            </script>
        </body>
    </html>

     注意:修改editor_api.js中的ueditor源码路径:baseURL = 'ueditor/_src/';

    (5)应用效果

  • 相关阅读:
    【转】GitHub 中国区前 100 名到底是什么样的人?
    不同服务器数据库之间的数据操作
    行列互换
    千万级数据查询
    用命令对sql进行备份
    通过SQL Server 2008数据库复制实现数据库同步备份
    各种字符串合并处理示例.
    字符串分解
    四大排序函数
    cross apply 和 outer apply
  • 原文地址:https://www.cnblogs.com/yshyee/p/14004897.html
Copyright © 2011-2022 走看看