初学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的大对象字段里吗?
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的大对象字段里吗?
解决方案 »
- 有没有可以简单明白的解释一下序列化的作用
- 关于spring两个很棘手的问题,高手帮帮我把,呜呜
- 请教Date转换
- java 设计模式的问题
- JMS造成的一个数据库错误:Cannot obtain XAConnection Creation of XAConnection for pool apsDBPool failed after waitSecs
- 求几条语句
- 在用eclipse和lomboz开发EJB时,出错。
- 请进来取分!!!!!!!
- 关于weblogic7的配置问题。
- jsp空间商的管理系统是怎么实现的,有没有类似系统
- 想学习java框架编web应用,只学习Struts1.x + JDBC 可以么
- webService的不知问题 期待高手解决
可以参考它的文档.
首先需要配置他的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这样它的文件上传功能就可以使用.如果上传文件名包含有中文.那么你还需要进行一些其他的配置.具体做法不罗嗦了.你可以去看看他的文档,写得很详细.