Good morning
I'm a very very beginer java developper :p and I would like to integer FCKeditor in my jsp pages, using Netbeans, I followed the doc, tried to apply what has been said on this link: http://www.jroller.com/coreteam/entry/using_fckeditor_in_jsp_web
but in vain, I have always the error:
the absolute uri http://fckeditor.net/tags-fckeditor cannot be resolved in either web.xml
The web.xml in the tutorial mentionned above contains a sevlet: com.app.servlet.ConnectorServlet, but when created it, I had to create several other paquages, classes, servlets...mentionned in the (import...) so do I have to creat all paquages and classes mentioned here: http://www.jarvana.com/jarvana/view/net/fckeditor/java-core/2.6/java-core-2.6-javadoc.jar!/index.html???knowing that I've already added all .jar files to the /WEB-INF/lib directory. see the "jarfiles.png"
Here is the web.xml file:
<!-- Servlets configuration --> <servlet> <servlet-name>Connector</servlet-name> <servlet-class>com.app.servlet.ConnectorServlet</servlet-class> <init-param> <param-name>debug</param-name> <param-value>true</param-value> </init-param> <load-on-startup>1</load-on-startup> </servlet> <servlet> <servlet-name>SimpleUploader</servlet-name> <servlet-class>com.app.servlet.UploadServlet</servlet-class> <init-param> <param-name>debug</param-name> <param-value>true</param-value> </init-param> <init-param> <param-name>enabled</param-name> <param-value>false</param-value> </init-param> <init-param> <param-name>AllowedExtensionsFile</param-name> <param-value></param-value> </init-param> <init-param> <param-name>DeniedExtensionsFile</param-name> <param-value>php|php3|php5|phtml|asp|aspx|ascx|jsp|cfm|cfc|pl|bat|exe|dll|reg|cgi</param-value> </init-param> <init-param> <param-name>AllowedExtensionsImage</param-name> <param-value>jpg|gif|jpeg|png|bmp</param-value> </init-param> <init-param> <param-name>DeniedExtensionsImage</param-name> <param-value></param-value> </init-param> <init-param> <param-name>AllowedExtensionsFlash</param-name> <param-value>swf|fla</param-value> </init-param> <init-param> <param-name>DeniedExtensionsFlash</param-name> <param-value></param-value> </init-param> <load-on-startup>1</load-on-startup> </servlet> <!-- The files viewer connector --> <servlet-mapping> <servlet-name>Connector</servlet-name> <url-pattern>/editors/FCKeditor_2.6/editor/filemanager/browser/default/connectors/jsp/connector</url-pattern> </servlet-mapping> <!-- The files uploader connector --> <servlet-mapping> <servlet-name>SimpleUploader</servlet-name> <url-pattern>/editors/FCKeditor_2.6/editor/filemanager/connectors/simpleuploader</url-pattern> </servlet-mapping>
and the index.jsp file:
<%@ page contentType="text/html; charset=utf-8"%> <%@ taglib uri="http://fckeditor.net/tags-fckeditor" prefix="FCK" %> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> <html> <head> <title>FCKeditor - JSP Sample</title> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> <link href="../sample.css" rel="stylesheet" type="text/css" /> <script type="text/javascript"> function setEditorValue( instanceName, text ) { // Get the editor instance that we want to interact with. var oEditor = FCKeditorAPI.GetInstance( instanceName ) ; // Set the editor contents. oEditor.SetHTML( text ) ; } function getEditorValue( instanceName ) { // Get the editor instance that we want to interact with. var oEditor = FCKeditorAPI.GetInstance( instanceName ) ; // Get the editor contents as XHTML. return oEditor.GetXHTML( true ) ; // "true" means you want it formatted. } </script> </head> <body> <h1>Hello World! FCKeditor</h1> <hr><% String submit = request.getParameter("submit"); if (submit != null) { String content = request.getParameter("content"); if (content == null) content = ""; out.println("Content: " + content); out.println("<hr>"); } %> <form method="post"> <FCK:editor id="content" basePath="/FCKeditor/" height="300" skinPath="/FCKeditor/editor/skins/office2003/" 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"> </FCK:editor> <br> <input type="button" value="Set Value" onclick="setEditorValue('content', 'Hello World!')" /> <input type="button" value="Get Value" onclick="alert(getEditorValue('content'))" /> <input type="submit" value="Submit" name="submit" /> </form> </body> </html>
I'm using FCKeditor 2.6.
There was also an other proble, when I tried to download FCKeditor, I didn't finfd the .jar libraries and .js files in the same .zip, so I had to downlaod 2 different folders: fckeditor-java-2.6-bin.zip (for the .jar) and FCKeditor_2.6.9.zip (for the .js) from two different web sites....
I'v already tried to integer CKeditor in .jsp pages, I've got no errors but the page just contained a simple taexarea, but it worked fine in .html pages....
Thank you for your help :)