初学FCKeditor,做了上传文章的一个例子,有2个页面,数据库是mysql。第一页面:
index.jsp
<%@ page language="java" pageEncoding="UTF-8"%>
<%@ page import="com.fredck.FCKeditor.*"%>
<%@ taglib uri="http://fckeditor.net/tags-fckeditor" prefix="FCK" %><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    
    <title>My JSP 'index.jsp' starting page</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>
    This is my JSP page. <br>
        <FCK:editor id="content" basePath="/TestEditor/FCKeditor/"
         width="700" height="500"
          skinPath="/TestEditor/FCKeditor/editor/skins/silver/"
      toolbarSet = "Default">杈撳叆鏂伴椈鍐呭</FCK:editor>
  </body>
</html>
第二个页面:show.jsp:  
<%  
String content = request.getParameter("content");  
out.print(content);  
%> 
 
到此能显示FCKeditor里的内容,请问接下来如何才能实现上传文章的功能,是把得到的content保存到mysql的大对象字段里吗?

解决方案 »

  1.   

    varchar类型上传图片视频等是FCKeditor的另外一个功能。
      

  2.   

    楼主说的对,就是FCKeditor里的内容保存到数据库中,所以这个字段你需要给的大一些,如果不写到数据库里,你通过I/O,流写到其他文件里也行,比如写到一个HTML文件里,这样你在页面上动态加上工程下HTML的连接,就会出现文本编辑器里的内容了
      

  3.   

    文件上传是FCKeditor的一个功能.需要配置服务
    可以参考它的文档.
    首先需要配置他的web.xml文件.
    <servlet>
    <servlet-name>Connector</servlet-name>
    <servlet-class>
      net.fckeditor.connector.ConnectorServlet  //这个类在它的核心包中
    </servlet-class>
    </servlet>
    .......
    <servlet-mapping>
    <servlet-name>Connector</servlet-name>
    <url-pattern>
    /fckeditor/editor/filemanager/connectors/*
    </url-pattern>
    </servlet-mapping>
    第二步:建一个fckeditor.properties文件把它放到classpath路径下面  注意:名字和路径都是固定的,不能改变
    把这项配置放在里面: connector.userActionImpl=net.fckeditor.requestcycle.impl.UserActionImpl这样它的文件上传功能就可以使用.如果上传文件名包含有中文.那么你还需要进行一些其他的配置.具体做法不罗嗦了.你可以去看看他的文档,写得很详细.