一聚教程网:一个值得你收藏的教程网站

最新下载

热门教程

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

时间:2011-02-20 编辑:简简单单 来源:一聚教程网

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" %>



解决方法

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/

热门栏目