It is so easy to use FCKeditor in your Java/JSP web pages. Just download the JSP Integration Pack for using FCKeditor inside a java server page without the complexity of using a Java scriptlets or the JavaScript API.
Contents
Configuring your site
Step 1
First step you should take in order to integrate FCKeditor with you page is downloading the latest version of the JSP Integration Pack from from our download site.You can find the latest version of the package under this address:
http://www.fckeditor.net/download
Note: The main code is not included in this package, just the JSP Integration Pack. You still need the FCKeditor scripts to be able to run it, so you should download it as well
Step 2
- Unpack the Java Integration Library in a directory named "fckeditor".
- Unzip the content of the FCKeditor release of your choice inside the "fckeditor\web" folder.
Integration
Step 1
Create in tomcat (or any servlet container) a new context named "FCKeditor" that points to the previously created "fckeditor\web" folder.
Sample code
<%@ page language="java" import="com.fredck.FCKeditor.*" %> <html> <head> <title>FCKeditor - JSP Sample</title> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> <script type="text/javascript"> function FCKeditor_OnComplete( editorInstance ) { window.status = editorInstance.Description ; } </script> </head> <body> <form action="sampleposteddata.jsp" method="get" target="_blank"> <% FCKeditor oFCKeditor ; oFCKeditor = new FCKeditor( request, "EditorDefault" ) ; oFCKeditor.setBasePath( "/fckeditor/" ) ; oFCKeditor.setValue( "This is some <strong>sample text</strong>. You are using <a href=\"http://www.fredck.com/fckeditor/\">FCKeditor</a>." ); out.println( oFCKeditor.create() ) ; %> <input type="submit" value="Submit"> </form> </body> </html>
Additional information
- Point your browser to http://domainName.ext/FCKeditor/_samples/index.jsp for the list of the samples.