ÔÚJSPÖÐʹÓÃJS·½Ê½ÒýÓÃckeditor
×î½üÔÚ×Ô¼º×öµÄÏîÄ¿ÖÐÐèÒªÓõ½ÔÚÏß±à¼Æ÷,ÔÚÍøÉÏËÑÁËÏ£¬·¢ÏÖÁËckeditor£¬µ±È»ÍøÉÏÓкü¸ÖÖÔÚÏß±à¼Æ÷£¬²»ÖªµÀΪʲôѡÔñÁËckeditor,±¾À´´òËãÓÃFckeditorµÄ£¬µ«ÊÇ¿´µ½ÍøÉÏ»¹ÐèÒªµ¼ÈëºÃ¼¸¸öJAR°ü£¬»¹Òª½øÐÐÒ»¶ÑÅäÖã¬ÓеãÂé·³£¬±¾À´ÏîÄ¿ÖÐÒ²¾ÍÓÃһϣ¬»¹ÒªÄÇôÂé·³µØÈ¥ÅäÖá£
ÓÚÊÇÈ¥ckeditorÍøÕ¾ÏÂÔØÁË×îа汾µÄckeditor£¬ckeditorÊÇfckeditorµÄÏÂÒ»´ú°æ±¾£¬ÓÚÊÇ˳´ø°ÑfckeditorºÍckeditor¶¼ÏÂÔØÏÂÀ´²âÊÔÏÂÄĸö¸üºÃÓ᣾¹ý±È½Ï»¹ÊÇckeditorµÄÃż÷±È½ÏµÍ£¬Á½ÐдúÂë¾Í¸ã¶¨ÁË£¬µ«ÊÇÅäÖÃÁËfckeditorȴûÓÐÆð×÷Óã¬ÓÚÊǾÍÑ¡ÔñÁËckeditor£¬Ò²Ðí´ó¼Ò»¹ÊÇÓÃfckeditorµÄ±È½Ï¶à¡£²»¹ý¼ÈÈ»ckeditorÃż÷µÍÄǾÍ×ÔȻѡÔñckeditorÁË¡£
²»¶à·Ï»°ÁË£¬ÏÂÃæ¾ÍÀ´ËµÏÂckeditorµÄʹÓðɣ¡
ҪʹÓÃckeditor£¬µ±È»Ê×ÏȾÍÊÇÈ¥http://ckeditor.com/ (ckeditorÍøÕ¾)ÏÂÔØckeditorµÄѹËõ°ü£¬ÏÖÔÚ×îеÄÊÇckeditor_3.3.zip
ÏÂÔغó½«Ñ¹Ëõ°ü½âѹ£¬½«½âѹºóÎļþ¼ÐÖеÄckeditorÎļþ¼Ðcopyµ½×Ô¼ºµÄwebÏîÄ¿µÄWebRootĿ¼Ï¡£
´ò¿ªckeditorĿ¼£¬¿ÉÒÔ¿´µ½Îļþ¼Ð½á¹¹ÈçÏÂ
ckeditor
---_samples
---_source
---adapters
---images
---lang
---plugins
---skins
---themes
....
---ckeditor.js
---config.js
...
´Óÿ¸öÎļþ¼ÐºÍÿ¸öÎļþµÄÃû×ÖÎÒÃǾͿÉÒÔºÜÈÝÒ׿´³öËüÃǵÄ×÷Óã¬_samplesÎļþ¼ÐÏ·ŵÄ×ÔÈ»¾ÍÊǹ©ÎÒÃÇѧϰÈçºÎʹÓõÄÑùÀý³ÌÐòÁË¡£
Äõ½Ò»¸öÎÒÃÇÒÔǰûÓùýµÄ¶«Î÷£¬Ê×ÏÈÒª¿´µÄµ±È»¾ÍÊÇËü¸øµÄÀý×ÓÁË£¬Õâ¿ÉÒÔÈÃÎÒÃǶÔÕâ¸ö³ÌÐòÓиöÕûÌåµÄÁ˽Ⲣ¿ìËÙÕÆÎÕ¼òµ¥µÄʹÓ÷½·¨¡£
ÏëÒªÔÚJSPÒ³ÃæÖÐÒýÓÃckeditorÊǷdz£¼òµ¥µÄÒ»¼þÊ£¬Ç°ÃæÎÒÃÇÖ»ÒªÒѾ½«½âѹµÄckeditorÎļþ¼Ðcopyµ½WebRootĿ¼ÏÂÁË£¬Ö»ÐèÒªÔÚjspÎļþµÄ´úÂëÖÐÒª¼ÓÈëckeditorµÄλÖüÓÉÏÈçÏ´úÂ룬(±ÈÈçÎÒÃÇÒªÔÚÒ»¸öformÖÐʹÓÃckeditor)¡£
ÏÂÃæÔÚindex.jsp(±ÊÕß½¨µÄÒ»¸ö²âÊÔÒ³Ãæ)ÖÐÒýÓÃckeditor²¢²âÊÔ
<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%
String path = request.getContextPath();
%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<script type="text/javascript" src="ckeditor/ckeditor.js"></script>
</head>
<body>
<%
String content=request.getParameter("editor1");
 
Ïà¹ØÎĵµ£º
package com.wxpn.tutorial.db;
import java.io.IOException;
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.SQLException;
import java.sql.SQLWarning;
import java.sql.Statement;
import java.util.Date;
/**
* ÃèÊö: Êý¾Ý¿âÁ¬½Ó³ØÀà
*
*
&n ......
<%@ page contentType="text/html;charset=GBK"%>
<%@page import="java.util.*"%>
<%@page import="java.io.*" %>
<%
//ÔÚÕâÀïÈç¹ûд³É“WEB-INF\templates\template.htm”³ÌÐò»á±¨´í
String filePath = request.getRealPath("/")+"WEB-INF/templates/template.htm"; &nbs ......
ÒÔÇ°ÓÐÌáµ½¹ýÂÒÂëÎÊÌ⣬×î½üÔÚʹÓÃwindow.openʱÓÖ³öÏÖ´ËÀàÎÊÌ⣬ÏÖ½â¾öÈçÏ£º
1£ºÊ¹ÓÃencodeURIComponentº¯Êý¶Ô²ÎÊý½øÐд¦Àí£¬ÀýÈ磺window.open("html.jsp?name=" + encodeUrlComponent(value)));
2£ºÐÞ¸Ätomcat·þÎñÆ÷µÄserver.xmlÎļþÌí¼Ó£ºuseBodyEncodingForURI="true"»òÕß
URIEncoding=" ......
ʹÓÃRandomAccessFileÀàÌṩµÄ¹¦ÄÜÀ´ÊµÏÖÎļþÉÏ´«¡£µ±ÎÒÃÇÏë¶ÔÒ»¸öÎļþ½øÐжÁд²Ù×÷ʱ£¬¿ÉÒÔ´´½¨Ò»¸öÖ¸Ïò¸ÃÎļþµÄRandomAccessFileÁ÷¼´¿É£¬ÕâÑù¼È¿ÉÒÔ´ÓÕâ¸öÁ÷ÖжÁÈ¡Õâ¸öÎļþµÄÊý¾Ý£¬Ò²Í¨¹ýÕâ¸öÁ÷дÈëÊý¾Ý¸øÕâ¸öÎļþ¡£
ÀûÓÃJavaBean¸ºÔð½«Óû§Ñ¡ÔñµÄÎļþÉÏ´«µ½·þÎñÆ÷¡£bean¿ÉÒÔÈÃÄÚÖöÔÏórequestµ÷Ó÷½·¨getInputStream£ ......