JSP中简单使用CKEditor入门教程

 一、下载CKEditor

       1. 直接下载地址,当前最新版本为3.6:http://ckeditor.com/download

二、安装CKEditor

       解压ckeditor_3.5.zip,得到ckeditor文件夹,将ckeditor整个文件夹复制到项目工程的根目录下,即WebContent下 

目录如下:



三、验证CKEditor是否安装成功

       部署运行项目,访问: http://localhost/项目名称/ckeditor/_samples/index.html(此处项目名为sample)

       则可出现 “CKEditor Samples List” 的Demo页面,说明CKeditor已安装成功 

四、编写一个JSP(test.jsp)代码如下:

<%@ page language="java" import="java.util.*" 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>  
<body>
  <head>  
    <script type="text/javascript" src="<%=request.getContextPath()%>/ckeditor/ckeditor.js"></script>  
    <script type="text/javascript">     
    //<![CDATA[    
        CKEDITOR.replace('content',{toolbar:'Full',skin:'kama'});    
    //]]>     
    </script>    
    <title>jCuckoo 's ckedit page</title>  
  </head>  
  <body>  
    <textarea class="ckeditor" cols="80" id="content" name="content" rows="10">     
     CKEditor Test......(此处的内容会在编辑器中显示)</textarea>     
  </body>  
</html>  

五、运行结果如下:











评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值