javaweb项目中引入CKeditor组件

CKeditor的安装与使用  for jsp:

FCKeditor是一个专门使用在网页上属于开放源代码的所见即所得文字编辑器。

一、下载CKEditor

      

      http://download.cksource.com/CKEditor/CKEditor/

打开连接往下拉,可以找到最新的版本。 下载zip包,并解压。

   

二、安装CKEditor

       解压ckeditor_4.11.1_standard.zip,得到ckeditor目录,将ckeditor整个目录拷贝到WebRoot下。

三、编辑ckeditorDemo.jsp

<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <base href="<%=basePath%>">
    
    <title>ckeditor 的使用</title>
	<meta http-equiv="pragma" content="no-cache">
	<meta http-equiv="cache-control" content="no-cache">
	<meta http-equiv="expires" content="0">    
	<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
	<meta http-equiv="description" content="This is my page">
	<!--
	<link rel="stylesheet" type="text/css" href="styles.css">
	-->
	
	<!-- 引入ckeditor组件 --> 
	<script src="${pageContext.request.contextPath }/ckeditor/ckeditor.js"></script>
	
	<link rel="stylesheet" href="${pageContext.request.contextPath }/ckeditor/samples/css/sample.css">
  </head>
  
  <body>
  <form name="xiaohua" action="${pageContext.request.contextPath }/index" method="post">
    	评论区:<textArea  class="ckeditor" rows="20" cols="30" name="content"></textArea>
    	<br>
   </form>
  </body>
</html>

需要注意三个地方:

 

四、打开浏览器查看效果

输入:http://localhost:8080/xiaohua/ckeditorDemo.jsp

至此,就可以使用该组件,带来的非凡体验了。

评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值