项目常用工具类整理(二)--ckeditor的引用

一,首先你需要引入CKeditor包,附上下载地址http://ckeditor.com/download,将该压缩文件解压到你的webapp文件下就可以了。

二,在你的jsp页面中引用,同时对你的ckeditor进行配置工具。

<head>
<title>****</title>
<%@ include file="../common/common.jsp"%>
<script src="<%=basePath %>ckeditor/ckeditor.js"></script>
<script type="text/javascript">
/* CK Editer */
CKEDITOR.editorConfig = function( config ) {
	config.toolbar =
	[ { name: 'document', items: ['Source', '-', 'Preview'] },
		{ name: 'insert', items: ['Image', 'Flash', 'Table', 'HorizontalRule', 'SpecialChar', 'PageBreak',] },
		{ name: 'clipboard', items: ['Cut', 'Copy', 'Paste', 'PasteText', 'PasteFromWord', '-', 'Undo', 'Redo'] },
		{ name: 'styles', items: ['Styles', 'Format', 'Font', 'FontSize'] },
		{ name: 'links', items: ['Link', 'Unlink', 'Anchor'] },
		{ name: 'colors', items: ['TextColor', 'BGColor'] },
		"/",
		{ name: 'basicstyles', items: ['Bold', 'Italic', 'Underline', 'Strike', 'Subscript', 'Superscript', '-', 'RemoveFormat'] },
		{ name: 'paragraph', items: ['NumberedList', 'BulletedList', '-', 'Outdent', 'Indent', '-', 'Blockquote', 'CreateDiv', '-', 'JustifyLeft', 'JustifyCenter', 'JustifyRight', 'JustifyBlock', '-', 'BidiLtr', 'BidiRtl'] }
	];
	config.filebrowserImageUploadUrl = '../upload/CKImgUpload';
};
</script>
</head>

三,作为jsp的数据展现,体现一个循环的展示

<c:forEach items="${List }" var="cker" varStatus="i">
			<div id="ckEditers" title="${cker.name}" style="margin-bottom:30px; width: 98%;" >
				<textarea class="ckeditor onload" id="content_${cker.id}" name="content_${cker.id}">${cker.content}</textarea>				
			</div>
</c:forEach> 

四,作为jsp的数据录入

<form id="ff" method="post">
	 <table cellpadding="5">	    		
		<tr>
			<td valign="top" align="right">内容:</td>
			<td><textarea class="ckeditor" name="content"></textarea></td>
		</tr>
     </table>
</form

 

 

 

 

转载于:https://my.oschina.net/ytliyang/blog/675122

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值