【www.gdgbn.com--js教程】

fckeditor在jsp教程文件上传失败解决方法

我的代码如下

web.xml


connector
net.fckeditor.connector.connectorservlet
1


connector
/js/fckeditor/editor/filemanager/connectors/*

fck.jsp

<%@taglib uri="http://java.fckeditor.net" prefix="fck" %>
<script type="text/网页特效">
function fckeditor_oncomplete(editorinstance) {
window.status = editorinstance.description;
}
</script>



解决方法

web.xml


struts2

com.platform.my.struts2.helper.customfilters.myfckhelperfilterdispatcher


struts2
/*


connector
net.fckeditor.connector.connectorservlet
1


connector
/js/fckeditor/editor/filemanager/connectors/*


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教程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/

本文来源:http://www.gdgbn.com/wangyezhizuo/29185/