FCkjava三种调用方法

<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ taglib uri="/FCKeditor" prefix="FCK" %>
<%@ page language="java" import="com.fredck.FCKeditor.*" %>  


<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
   <head>
    
     <title>测试FCK</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">
     -->

   </head>
<body>

方法一:<br>

<form action="show.jsp" method="post" target="_blank">  
     <FCK:editor id="content" basePath="/db/fckeditor/" width="600" height="480" skinPath="/db/fckeditor/editor/skins/silver/"  
toolbarSet = "Default" >  
     默认内容测试
     </FCK:editor>  
     <input type="submit" value="Submit">  
</form>  

<br><br><br>

方法二:<br>
<form action="show.jsp" method="post" target="_blank">  
<%  
FCKeditor oFCKeditor ;  
oFCKeditor = new FCKeditor(request,"content") ;  
oFCKeditor.setBasePath( "/db/fckeditor/" ) ;
oFCKeditor.setWidth("600");
oFCKeditor.setHeight("480");
oFCKeditor.setValue( "input" );  
out.println( oFCKeditor.create() ) ;  
%>  
<input type="submit" value="Submit">  
</form>
<br> <br><br>
方法三:
<script type="text/javascript" src="fckeditor/fckeditor.js"></script>

<form action="show.jsp" method="post" target="_blank">  
<table border="0" width="700"><tr><td>  
<textarea id="content" name="content" style="WIDTH: 100%; HEIGHT: 400px">
input</textarea>  
<script type="text/javascript">  
var oFCKeditor = new FCKeditor('content');
oFCKeditor.BasePath = "/db/fckeditor/" ;  
oFCKeditor.Height = 400;
oFCKeditor.Width=600;
oFCKeditor.ToolbarSet = "Default" ;  
oFCKeditor.ReplaceTextarea();  
</script>  
<input type="submit" value="Submit">  
</td></tr></table>  
</form>  

   </body>
</html>

web.xml ---------------------------- -------------------其它说明

<web-app>
         <servlet>
                 <servlet-name>Connector</servlet-name>
                 <servlet-class>com.fredck.FCKeditor.connector.ConnectorServlet</servlet-class>
                 <init-param>
                         <param-name>baseDir</param-name>
将在FCKeditor/editor/下创建Image和Flash文件夹,用于存放上传文件
                         <param-value>/editor/</param-value>
                 </init-param>
                 <init-param>
                         <param-name>debug</param-name>
                         <param-value>false</param-value>调试时设为true
                 </init-param>
                 <load-on-startup>1</load-on-startup>
         </servlet>

         <servlet>
                 <servlet-name>SimpleUploader</servlet-name>
                 <servlet-class>com.fredck.FCKeditor.uploader.SimpleUploaderServlet</servlet-class>
                 <init-param>
                 <param-name>baseDir</param-name>
将在FCKeditor/editor/下创建Image和Flash文件夹,用于存放上传文件
                         <param-value>/editor/</param-value>
                 </init-param>
                 <init-param>
                         <param-name>debug</param-name>
                         <param-value>true</param-value>调试时设为true
                 </init-param>
                 <init-param>
                         <param-name>enabled</param-name>
                         <param-value>true</param-value>修改成true
                 </init-param>
                 <init-param>
                         <param-name>AllowedExtensionsFile</param-name>
                         <param-value></param-value>
                 </init-param>
                 <init-param>
                         <param-name>DeniedExtensionsFile</param-name>
                         <param-value>php|php3|php5|phtml|asp|aspx|ascx|jsp|cfm|cfc|pl|bat|exe|dll|reg|cgi</param-value>
                 </init-param>
                 <init-param>
                         <param-name>AllowedExtensionsImage</param-name>
                         <param-value>jpg|gif|jpeg|png|bmp</param-value>
                 </init-param>
                 <init-param>
                         <param-name>DeniedExtensionsImage</param-name>
                         <param-value></param-value>
                 </init-param>
                 <init-param>
                         <param-name>AllowedExtensionsFlash</param-name>
                         <param-value>swf|fla</param-value>
                 </init-param>
                 <init-param>
                         <param-name>DeniedExtensionsFlash</param-name>
                         <param-value></param-value>
                 </init-param>
                 <load-on-startup>1</load-on-startup>
         </servlet>

         <servlet-mapping>
                 <servlet-name>Connector</servlet-name>
和fckconfig.js的ImageBrowserURL等对应
                 <url-pattern>/editor/filemanager/browser/default/connectors/jsp/connector</url-pattern>
         </servlet-mapping>

         <servlet-mapping>
                 <servlet-name>SimpleUploader</servlet-name>
这里你可以按自己应用具体配置,需要和fckconfig.js的ImageUploadUrl等对应
                 <url-pattern>/editor/upload.do</url-pattern>
         </servlet-mapping>
</web-app>

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值