fckeditor的配置

1)copy 包fckeditor 和文件jquery.FCKEditor.js
2)引入1)中的两个js文件,同时记得引入jquery的js。
<script src="<%=request.getContextPath()%>/html/assets/js/jquery-1.8.3.js" type="text/javascript"></script>
<script src="<%=request.getContextPath()%>/html/assets/plugins/fckeditor/fckeditor.js" type="text/javascript" ></script>
<script src="<%=request.getContextPath()%>/html/assets/plugins/jquery.FCKEditor.js" type="text/javascript" ></script>

3)加入textarea标签
<td><textarea rows="18"   id="content" name="content" style="width:100%">${ad.content}</textarea></td>

4)加入js代码
<script type="text/javascript">
$.fck.config = {path: '<%=request.getContextPath()%>/html/assets/plugins/fckeditor/', width:650,height: 400 ,toolbar:'Default'};
$('textarea#content').fck();
</script>

5)加入servlet
<servlet>
		<servlet-name>ConnectorServlet</servlet-name>
		<servlet-class>
			net.fckeditor.connector.ConnectorServlet
		</servlet-class>
		<load-on-startup>1</load-on-startup>
	</servlet>

	<servlet-mapping>
		<servlet-name>ConnectorServlet</servlet-name>
		<!-- Do not wrap this line otherwise Glassfish will fail to load this file -->
		<!-- <url-pattern>/*/fckeditor/editor/filemanager/connectors/*</url-pattern> -->
		<url-pattern>/*/fckeditor/editor/filemanager/connectors/*</url-pattern> 
	</servlet-mapping>

你可能感兴趣的:(fckeditor)