初学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的大对象字段里吗?
解决方案 »
- 单点登录异常、
- 用java程序读word文档
- struts2 标签中添加动态变量的问题.请教高手~~~~~~~~~已经弄了很久了~~~~~~~~~~~~~~
- 请教 jdom如何对2个相同元素名的属性分别读取,设置其中的值??
- 为什么jboss只运行在jre环境下,但是jsp却能编译???
- java 中如何调用DB2存储过程返回的结果集
- JSP中的 tomcat 的设置,请教
- 请问怎样可以正常下载JBoss?
- 客户端调用sessionbean出错
- 怪怪怪!!!在swt中应用rmi出错
- 想学习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这样它的文件上传功能就可以使用.如果上传文件名包含有中文.那么你还需要进行一些其他的配置.具体做法不罗嗦了.你可以去看看他的文档,写得很详细.