富文本框的使用kindeditor

有时项目中需要引入富文本框(这里我简单的写一下使用步骤)

一、1、在工程wapapp下面建一个文件plugins(名字自己定为了放 kindeditor-4.1.10文件)将kindeditor-4.1.10放入该文件下

下载地址:http://download.pchome.net/design/homepage/download-170038.html

2、建一个jsp页面,代码如下:

<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>




Insert title here








	

其中文本框的宽、高都能设置,具体可以看下载下来的 kindeditor-4.1.10 的文档说明

3、其中jsp文件下面的:jsp/file_manager_json.jsp

//根目录路径,可以指定绝对路径,比如 /var/www/attached/
String rootPath = pageContext.getServletContext().getRealPath("/") + "attached/";
//根目录URL,可以指定绝对路径,比如 http://www.yoursite.com/attached/
String rootUrl  = request.getContextPath() + "/attached/";

其中attached 必须存在(可以在webapp底下新建一个attached )

4、在地址栏输入就行

http://localhost:8080/test5/kindeditorTest1.jsp

富文本框的使用kindeditor_第1张图片


你可能感兴趣的:(Java,富文本)