2020-12-21 12:44:53:[DEBUG][ org.nutz.mvc.impl.NutActionChainMaker.eval(NutActio
nChainMaker.java:51)] [org.nutz.mvc.impl.NutActionChainMaker]:Eval FAIL!! : publ
ic java.lang.Object com.yyt.cos.mvc.MvcAction.html(java.lang.String,java.lang.St
ring,java.lang.String,javax.servlet.http.HttpServletRequest,javax.servlet.http.H
ttpServletResponse,javax.servlet.http.HttpSession,javax.servlet.ServletContext,o
rg.nutz.lang.util.NutMap)
org.nutz.lang.born.BorningException: Fail to born or cast to 'com.yyt.sys.plug.M
yUploadAdaptor'
by args: [@({"charset":"UTF-8","filePool":{"proxy":{"home":{},"cursor":0,"size"
:1000}},"bufferSize":8192,"ignoreNull":true,"maxFileSize":8388608,"nameFilter":"
^(.+[.])(doc|docx|txt|xls|xlsx|jpg|png|gif|jpeg|bmp|zip|rar|7z|tag)$","contentTy
peFilter":null,"nameFilterPattern":{"pattern":"^(.+[.])(doc|docx|txt|xls|xlsx|jp
g|png|gif|jpeg|bmp|zip|rar|7z|tag)$","flags":0}})]
because:java.lang.RuntimeException: '{"charset":"UTF-8","filePool":{"proxy":{"h
ome":{},"cursor":0,"size":1000}},"bufferSize":8192,"ignoreNull":true,"maxFileSiz
e":8388608,"nameFilter":"^(.+[.])(doc|docx|txt|xls|xlsx|jpg|png|gif|jpeg|bmp|zip
|rar|7z|tag)$","contentTypeFilter":null,"nameFilterPattern":{"pattern":"^(.+[.])
(doc|docx|txt|xls|xlsx|jpg|png|gif|jpeg|bmp|zip|rar|7z|tag)$","flags":0}}' shoul
d be a directory or don't have permission to create it!
at org.nutz.lang.born.ConstructorCastingBorning.born(ConstructorCastingB
orning.java:23)
at org.nutz.ioc.weaver.DefaultWeaver.born(DefaultWeaver.java:78)
at org.nutz.ioc.ObjectProxy.get(ObjectProxy.java:69)
at org.nutz.ioc.impl.NutIoc.get(NutIoc.java:260)
at org.nutz.ioc.impl.NutIoc.get(NutIoc.java:270)
at org.nutz.mvc.impl.Loadings.evalObj(Loadings.java:334)
at org.nutz.mvc.impl.processor.AbstractProcessor.evalObj(AbstractProcess
or.java:48)
at org.nutz.mvc.impl.processor.AdaptorProcessor.evalHttpAdaptor(AdaptorP
rocessor.java:34)
at org.nutz.mvc.impl.processor.AdaptorProcessor.init(AdaptorProcessor.ja
var ioc = {
tmpFilePool : {
type : 'org.nutz.filepool.NutFilePool',
// 临时文件最大个数为 1000 个
args : [ "${app.root}/WEB-INF/tmps", 10000 ]
},
uploadFileContext : {
type : 'org.nutz.mvc.upload.UploadingContext',
singleton : false,
args : [ { refer : 'tmpFilePool' } ],
fields : {
// 是否忽略空文件, 默认为 false
ignoreNull : true,
// 单个文件最大尺寸(大约的值,单位为字节,即 1048576 为 1M)
maxFileSize : 3145728,
// 正则表达式匹配可以支持的文件名
nameFilter : '^(.+[.])(doc|docx|txt|xls|xlsx|jpg|png|gif|jpeg|bmp|pdf)$'
}
},
myUpload : {
type : 'com.yyt.sys.plug.MyUploadAdaptor',
singleton : false,
args : [ { refer : 'uploadFileContext' } ]
}
};
MyUploadAdaptor
public class MyUploadAdaptor extends UploadAdaptor {
Log log=Logs.get();
public MyUploadAdaptor() throws IOException {
super();
}
public MyUploadAdaptor(String filePath) {
super(filePath);
}
@Override
public Map<String, Object> getReferObject(ServletContext sc,
HttpServletRequest request, HttpServletResponse response,
String[] pathArgs) {
////////
}