0

I 've read many resources about this topic but haven't found any clarify solution yet. I followed each step in ckeditor & ckfinder tutorial and successfully implemented function of uploading image, but i can't integrate server browse function. It always shows this popup when start like below enter image description here

Some steps I 've done as following

web.xml

<filter>
    <filter-name>FileUploadFilter</filter-name>
    <filter-class>com.ckfinder.connector.FileUploadFilter</filter-class>
    <init-param>
        <param-name>sessionCookieName</param-name>
        <param-value>JSESSIONID</param-value>
    </init-param>
    <init-param>
        <param-name>sessionParameterName</param-name>
        <param-value>jsessionid</param-value>
    </init-param>
</filter>
<filter-mapping>
    <filter-name>FileUploadFilter</filter-name>
    <url-pattern>/ckfinder/core/connector/java/connector.java</url-pattern>
</filter-mapping>

<servlet>
    <servlet-name>SpringDispatcher</servlet-name>
    <servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
    <init-param>
        <param-name>contextConfigLocation</param-name>
        <param-value>/WEB-INF/config/SpringDispatcher-servlet.xml</param-value>
    </init-param>
    <load-on-startup>1</load-on-startup>
</servlet>
<servlet-mapping>
    <servlet-name>SpringDispatcher</servlet-name>
    <url-pattern>/</url-pattern>
</servlet-mapping>

<servlet>
    <servlet-name>ConnectorServlet</servlet-name>
    <servlet-class>com.ckfinder.connector.ConnectorServlet</servlet-class>
    <init-param>
        <param-name>XMLConfig</param-name>
        <param-value>/WEB-INF/config/config.xml</param-value>
    </init-param>
    <load-on-startup>1</load-on-startup>
</servlet>
<servlet-mapping>
    <servlet-name>ConnectorServlet</servlet-name>
    <url-pattern>/ckfinder/core/connector/java/connector.java</url-pattern>
</servlet-mapping>

config.xml

<baseDir>C:\Program Files\Apache Software Foundation\Tomcat 7.0\webapps\ROOT\upload</baseDir>
<baseURL>/upload</baseURL> <!-- just modified two attributes in default config -->

index.jsp

<%@ taglib uri="http://ckeditor.com" prefix="ckeditor" %>
<%@ taglib uri="http://cksource.com/ckfinder" prefix="ckfinder" %>

<textarea name="textareaId" id="textareaId"></textarea>
<ckfinder:setupCKEditor basePath="resources/js/ckfinder/" />
<ckeditor:replace replace="textareaId" basePath="resources/js/ckeditor" />

I also added dependence jars of ckeditor and ckfinder to classpath

These are all I've done. Is there any step I missed or did wrong And please show me full steps for achieving it with java

Thanks in advance

thoitbk
  • 269
  • 2
  • 9
  • 21
  • 2
    At first sight I don't see anything wrong with your configuration. Everything seems to be in order. Error 404 however is quite straightforward saying that some resource is missing or path is messed up somewhere. Do see anything interesting in server logs? If not, would there be a possibility to sends us your sample application or Eclipse/Netbeans project to http://cksource.com/contact? One of our technicians will check the problem and post here the answer. – Wiktor Walc Feb 12 '15 at 08:05
  • @Wiktor Walc Finally, I got it. I had to move both ckeditor and ckfinder folders to root directory instead of putting them on dedicated folder 'resources/js'. Thanks – thoitbk Feb 12 '15 at 09:42
  • There should be no problems with having files loaded from subfolders. Perhaps the missing slash at the beginning of `basePath` in both tags was the problem? – Wiktor Walc Feb 12 '15 at 10:43
  • @Wiktor Walc I added a slash at the beginning of basePath as you said, but it still didn't work. The same error happened. I inspected what requests sent from browser, there was an incorrect get request causing 404 error with url of `http://localhost/resources/js/ckfinder/core/connector/java/connector.java?command=Init`. It seemed to prepend resource/js to url of handling servlet `ckfinder/core/connector/java/connector.java` – thoitbk Feb 13 '15 at 00:19

0 Answers0