Hi,
Can anyone tell me how to Integrate FCKeditor for JAVA.
I'm unable to view FCKeditor where in which i can add/edit/format text/images instead i'm getting javascript errors.
Thanks in advance
Can anyone tell me how to Integrate FCKeditor for JAVA.
I'm unable to view FCKeditor where in which i can add/edit/format text/images instead i'm getting javascript errors.
Thanks in advance
Re: Integrate FCKeditor for JAVA
- Configuring your 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>
-Now, you have to configure some lines of your fckeditor.js:
var _FileBrowserLanguage = 'jsp' ; // asp | aspx | cfm | lasso | perl | php | py
var _QuickUploadLanguage = 'jsp' ; // asp | aspx | cfm | lasso | perl | php | py
FCKConfig.LinkBrowserURL = FCKConfig.BasePath + "filemanager/browser/default/browser.html?Connector=connectors/jsp/connector" ;
FCKConfig.ImageBrowserURL = FCKConfig.BasePath + "filemanager/browser/default/browser.html?Type=Image&Connector=connectors/jsp/connector" ;
FCKConfig.FlashBrowserURL = FCKConfig.BasePath + "filemanager/browser/default/browser.html?Type=Flash&Connector=connectors/jsp/connector" ;
- Now you have to watch if UniversalKey exist in your FCKEditor toolbars in fckeditor.js file too, and delete it.
This is all, I hope did help you.
Re: Integrate FCKeditor for JAVA
I forgot something.
http://dev.fckeditor.net/browser/FCKedi ... a/tags/2.3
For FCKeditor classes for Java
Re: Integrate FCKeditor for JAVA
I am trying to integrate FCKEditor in the JSP page but have encountered several problems. I am currently running Java 1.6 and Tomcat 6.
I have downloaded both JSP Integration Pack (FCKeditor-2.3) and FCKEditor (FCKeditor_2.6). Following is my folder structure in Tomcat:
/<my_web_app>
/FCKeditor
/WEB-INF
/classes
/lib
I have placed commons-fileupload.jar and FCKeditor-2.3 in my WEB-INF\lib directory. Inside my WEB-INF, i have modified my web.xml as below:
<!-- 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>
However, when i start the application in Tomcat, i have got the following:
Message:
FAIL - Application at context path /<my_web_app> could not be started
I know it's my web.xml giving problem, could anyone point out where did i do wrong ?
Thanks.
Re: Integrate FCKeditor for JAVA
vzent,
you probably missed: http://java.fckeditor.net/
Re: Integrate FCKeditor for JAVA
Hi mosipov,
Thanks for that link, i just downloaded "FCKeditor.Java integration version 2.4" and decided to start everything from scratch.
Under the "Manual installation", i chose the 2nd approach which used "fckeditor-java-2.4-beta-1-bin.zip (or tar.gz)", i managed to run the demo at my browser (http://localhost:8080/fckeditor-java-demo-2.4-beta-1/).
But i still having difficulties in integrating my JSP and FCKEditor. I have tried to create a JSP page with the following:
But i have got these errors when i run it:
org.apache.jasper.JasperException: The absolute uri: http://java.fckeditor.net cannot be resolved in either web.xml or the jar files deployed with this application
org.apache.jasper.compiler.DefaultErrorHandler.jspError(DefaultErrorHandler.java:51)
org.apache.jasper.compiler.ErrorDispatcher.dispatch(ErrorDispatcher.java:409)
org.apache.jasper.compiler.ErrorDispatcher.jspError(ErrorDispatcher.java:116)
org.apache.jasper.compiler.TagLibraryInfoImpl.generateTLDLocation(TagLibraryInfoImpl.java:315)
org.apache.jasper.compiler.TagLibraryInfoImpl.<init>(TagLibraryInfoImpl.java:148)
org.apache.jasper.compiler.Parser.parseTaglibDirective(Parser.java:420)
org.apache.jasper.compiler.Parser.parseDirective(Parser.java:476)
org.apache.jasper.compiler.Parser.parseElements(Parser.java:1426)
org.apache.jasper.compiler.Parser.parse(Parser.java:133)
org.apache.jasper.compiler.ParserController.doParse(ParserController.java:216)
org.apache.jasper.compiler.ParserController.parse(ParserController.java:103)
org.apache.jasper.compiler.Compiler.generateJava(Compiler.java:167)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:306)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:286)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:273)
org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:566)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:317)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:320)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:266)
javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
1) I have no idea what's gone wrong here, what should be in my web.xml ?
2) Must i use Maven 2 ?
3) How should the directory like in my apache container ?
Thank you for your time, thanks.
Re: Integrate FCKeditor for JAVA
Hi vzent,
1)
there is the first error you have:
you messed up XML syntax with regular syntax. You should choose either one like I have documented on the page.
The cause of the exception is either you did not put the jar in your classpath or are are not using a servlet 2.4 compliant web.xml/web app.
Please take a look at the demo WAR and read the installation again carefully.
2) you do not need to use maven in your development but Maven makes life a lot easier when you do so.
3) what directory? It is already sufficent to unzip the fckeditor folder into your webapp.
Re: Integrate FCKeditor for JAVA
Really thanks for your reply, i have tried several times to Integrate FCKEditor in my JSP. I have successfully run the demo app , explored all Sample 1 to Sample 7.
I think i probably miss out this part
FCKeditor installation
Although the public distribution is fine, it still contains a lot of superfluous files for a Java environment. Use the following Ant target on the FCKeditor zip file (1,25 MiB) to create a cleaner and smaller distribution zip file (986 KiB).
How can i use the following (posted by you on the website) to compile and install the Fckeditor. I am kinda confused here.
What i did was to create a build.xml on my desktop and put all the above in it, and i try to add the build.xml in my IntelliJ7.0, but my IntelliJ shows nothing.
How should i build the FCKEditor using ant and install properly ? Please guide.
Again mosipov, thank you for your time.
Re: Integrate FCKeditor for JAVA
maybe my instructions on the page were not clear enough or basically having problems to understand the point.
I will try to break it down for you briefly:
You have your webapp in IDEA, right?
Let's say / is the root of the webapp directory.
So a basic directory listing would be:
now, you have to put the jar files into /WEB-INF/lib first, second put the fckeditor folder into / extracted from FCKeditor_2.6.zip. Now create a JSP file and declare the taglib and put <FCK:editor instanceName="Default" /> into the JSP body and you are done. It will help tremendously if you extract the WAR file and see your JSP files how it has tom be done.
Ant is not necessary by any means. The Ant Target is just for your convenience to create form the FCKeditor_2.6.zip a skimmed zip file. No more, no less.
I hope it is clearer now.
Re: Integrate FCKeditor for JAVA
it works now ! am looking through how to use the API.
Do you have any JSP example whereby you let your user do whatever formatting they want in the FCKeditor, then you save the HTML source.
For instance i wana store in my DB and subsequently i could retrieve it for display.
Thanks !
Re: Integrate FCKeditor for JAVA
vzent,
this is easy.
Take this code for example:
When a user hits save, the content will be sent to MyEditorServlet and you will be able to retrieve the entire content of the editor (see sampleposteddata.jsp for more details).
Inside this servlet you can fetch the data and store into the DB:
How to do the otherway around?
Let the use choose the content from the DB which he wants to load, take the params into a Servlet, send a sql quiry and put the database content into the request:
back again in your JSP:
The editor will now load the date from a row cell in your database.
Re: Integrate FCKeditor for JAVA
Hi mosipov,

Thanks ! i have tried that and it works very well ! But if i want to store the HTML source such as "<b>Hello</b>", how should i do it since request.getParameter() will only return me the content with HTML formatting.
Thanks for sharing your sample codes, it made my learning process faster !
Re: Integrate FCKeditor for JAVA
Your statement contains a contradiction! You want the store the HTML source:
And this is exactly what you want, the source code
Attachments:
Re: Integrate FCKeditor for JAVA
Thanks for the prompt reply again ! Sorry for that, what i actually meant was to store the HTML source, my bad.
In your previous post, i only see debugger output, did you have any source code attached ?
Thanks !
Re: Integrate FCKeditor for JAVA
If you want to store the HTML source the you could easily do:
btw, this is getting off topic
Re: Integrate FCKeditor for JAVA
Thanks mosipov,

I know how to play with it now, thanks. My misunderstanding on request.getParameter("EditorDefault"), i thought this will NOT return the HTML source, but it actually does, i have no problem now.
Thanks for the support and patience.
Thank you for your time.
Re: Integrate FCKeditor for JAVA
Check the front page once in a while. We will release the final probably in July and will start working on 2.5 soon.
Re: Integrate FCKeditor for JAVA
Hi mosipov,

Will check out the new version. Your support is very useful and it means a lot to me.
I have another gem in my box now
Thanks !
Re: Integrate FCKeditor for JAVA
Thanks a lot!
I believe that great software cannot survive without great support!
Re: Integrate FCKeditor for JAVA
<servlet-class>net.fckeditor.connector.UploadServlet</servlet-class>
and
com.app.servlet.UploadServlet
in web.xml but nothing worked....
Re: Integrate FCKeditor for JAVA
Re: Integrate FCKeditor for JAVA
Thanks,
Humesh
Re: Integrate FCKeditor for JAVA
Integration with Spring MVC
Hi,
With springMVC Its not mapping with my dispathcher servelet. Do i need to change any directory structure. Since Its static pages and i dont need a controller for it.