FCKeditor is an open source project on sourceforge.net. It mainly implements the function of an online web page editor, allowing web programs to have powerful editing functions such as MS Word. The official website is http://www.fckeditor.net , which supports ASP.Net, ASP, ClodFusion, PHP, Java and other languages on the server side, and supports mainstream browsers such as IE 5+, Mozilla, and Netscape.
First download fckeditor from the official website. Note that there are two packages, one is the main file and the other is the jsp integration package.
1. Unzip FCKeditor_2.2.zip, (FCKeditor main file), and copy the FCKeditor directory to the root directory of the website.
2. Unzip FCKeditor-2.3.zip, (jsp, FCKeditor integration package). Function: This is the JSP Integration Pack for using FCKeditor inside a java server page without the complexity of using a Java scriptlets or the javascript api.
3. Copy the two servlet and servlet-mapping definitions in FCKeditor-2.3/web/WEB-INF/web.xml to your own Modify
<servlet-mapping>
in the project's web.xml file
<servlet-name>Connector</servlet-name>
<url-pattern>/editor/filemanager/browser/default/connectors/jsp/connector</url-pattern>
</servlet-mapping>
<servlet-mapping>
<servlet-name>SimpleUploader</servlet-name>
<url-pattern>/editor/filemanager/upload/simpleuploader</url-pattern>
</servlet-mapping>
for
<servlet-mapping>
<servlet-name>Connector</servlet-name>
<url-pattern>/FCKeditor/editor/filemanager/browser/default/connectors/jsp/connector</url-pattern>
</servlet-mapping>
<servlet-mapping>
<servlet-name>SimpleUploader</servlet-name>
<url-pattern>/FCKeditor/editor/filemanager/upload/simpleuploader</url-pattern>
</servlet-mapping>
4. Copy the files in the FCKeditor-2.3/web/WEB-INF/lib directory to the lib folder of your own project
5. Add to the jsp interface where FCKeditor needs to be used:
// Add at the beginning of the file
<%@ taglib uri=" http://fckeditor.net/tags-fckeditor " prefix="FCK" %>
//Add where you want to use it
<FCK:editor id="content" basePath="/FCKeditor/"
imageBrowserURL="/FCKeditor/editor/filemanager/browser/default/browser.html?Type=Image&Connector=connectors/jsp/connector"
linkBrowserURL="/FCKeditor/editor/filemanager/browser/default/browser.html?Connector=connectors/jsp/connector"
flashBrowserURL="/FCKeditor/editor/filemanager/browser/default/browser.html?Type=Flash&Connector=connectors/jsp/connector"
imageUploadURL="/FCKeditor/editor/filemanager/upload/simpleuploader?Type=Image"
linkUploadURL="/FCKeditor/editor/filemanager/upload/simpleuploader?Type=File"
flashUploadURL="/FCKeditor/editor/filemanager/upload/simpleuploader?Type=Flash">
this is default content :)
</FCK:editor>
Start server testing. . . . After success, let's slim down FCKeditor.
1. Delete all folders starting with "_" underscore in the FCKeditor directory and subdirectories. 2. Only fckconfig.js, fckeditor.js, fckstyles.xml, remain in the FCKeditor root directory. Delete all the rest of fcktemplates.xml 3. Clear the files and folders in the editor/filemanager/upload directory.
4. You can also delete the skin files in the editor/skins directory, leaving only the default set of skins (if you do not need to change skins)
5. You can also delete the files in the editor/lang directory and keep only the en.js, fcklanguagemanager.js, zh-cn.js, zh.js files (English, simplified Chinese, and traditional Chinese should generally be enough:) )
to complete , does it feel a lot more refreshing now?
Other questions:
When used in struts+spring+hibernate, a report may appear in the upload image function:
The output format must have a '{http://xml.apache.org/xalan}content-handler' property!
If it is wrong, delete xalan*.jar in the WEB-INF/lib directory and try
the security issue:
If ordinary users can also use FCKEditor in the foreground, pay attention to related security issues. Do not use the default ToolBar when using it in the foreground.
To remove the add image, flash, and image field buttons, configure the values in those arrays at about 78 lines in fckconfig.js as a function on the interface. You can forcefully try out what each set of values represents. :P
This completes the installation of FCKeditor. For detailed configuration, you can see the examples in the web/_samples directory in the FCKeditor-2.3.zip, (jsp, FCKeditor integration package) folder.