FCKeditor in JSP Tutorial file upload failed Solution
My code is as follows
Xml
<servlet>
<servlet-name>connector</servlet-name>
<servlet-class>net.fckeditor.connector.connectorservlet</servlet-class>
<load-on-startup>1</load-on-startup>
</servlet>
<servlet-mapping>
<servlet-name>connector</servlet-name>
<url-pattern>/js/fckeditor/editor/filemanager/connectors/*</url-pattern>
</servlet-mapping>
fck.jsp
<% @taglib uri= "http://java.fckeditor.net" prefix= "FCK"%>
<script type= "text/web Effects" >
function Fckeditor_oncomplete (editorinstance) {
Window.status = editorinstance.description;
}
</script>
<fck:editor instancename= "Platform_partner" height= "250px" width= "700px" >
<jsp:attribute name= "value" ><s:property value= "Partner.info.platform_partner" escape= "false"/> </ Jsp:attribute>
</fck:editor>
Solving method
Xml
<filter>
<filter-name>struts2</filter-name>
<!--<filter-class>org.apache.struts2.dispatcher.ng.filter.strutsprepareandexecutefilter</ Filter-class>-->
<filter-class>com.platform.my.struts2.helper.customfilters.myfckhelperfilterdispatcher</filter-class >
</filter>
<filter-mapping>
<filter-name>struts2</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping>
<!--FCKeditor-->
<servlet>
<servlet-name>connector</servlet-name>
<servlet-class>net.fckeditor.connector.connectorservlet</servlet-class>
<load-on-startup>1</load-on-startup>
</servlet>
<servlet-mapping>
<servlet-name>connector</servlet-name>
<url-pattern>/js/fckeditor/editor/filemanager/connectors/*</url-pattern>
</servlet-mapping>
Myfckhelperfilterdispatcher.java (My custom filter)
Package com.platform.my.struts2.helper.customfilters;
Import Org.apache.struts2.dispatcher.ng.filter.strutsprepareandexecutefilter;
Import javax.servlet.*;
Import javax.servlet.http.*;
Import java.io.*;
public class Myfckhelperfilterdispatcher extends Strutsprepareandexecutefilter {
public void Dofilter (ServletRequest req, servletresponse Res, Filterchain chain) throws IOException, Servletexception {
String url = ((https tutorial ervletrequest) req). Getrequesturi ();
if (Url.indexof ("FCKeditor") < 0) {
Super.dofilter (req, res, chain);
}
else{
Chain.dofilter (req, res);
}
}
}
Fckeditor.properties
Connector.useractionimpl=net.fckeditor.requestcycle.impl.useractionimpl
Fckeditor.basepath=/js/fckeditor
connector.userfilespath=/partner/uploads/