freeMarkerConfigurer: {
type: "org.nutz.plugins.view.freemarker.FreeMarkerConfigurer",
events: {
create: 'init'
},
args: [
{refer: "configuration"},
{app: "$servlet"},
"web/view",
".ftl",
{refer: "freemarkerDirectiveFactory"}
]
},
运行起来后,第一次初始化会产生如下异常
Caused by: org.nutz.castor.FailToCastObjectException: Fail to cast from <java.util.HashMap> to <javax.servlet.ServletContext> for {{app=$servlet}}
at org.nutz.castor.Castors.cast(Castors.java:262)
at org.nutz.castor.Castors.castTo(Castors.java:316)
at org.nutz.lang.Lang.array2ObjectArray(Lang.java:1127)
at org.nutz.lang.born.Borns.evalWithArgs(Borns.java:97)
at org.nutz.lang.born.Borns.eval(Borns.java:58)
at org.nutz.lang.Mirror.getBorning(Mirror.java:965)
at org.nutz.ioc.impl.ObjectMakerImpl.make(ObjectMakerImpl.java:102)
... 40 common frames omitted
Caused by: org.nutz.lang.born.BorningException: Fail to born or cast to 'javax.servlet.ServletContext'
by args: []
because: No suitable Constructor or Factory Method!!
at org.nutz.lang.Mirror.born(Mirror.java:1008)
at org.nutz.lang.Lang.map2Object(Lang.java:1173)
at org.nutz.castor.castor.Map2Object.cast(Map2Object.java:14)
at org.nutz.castor.castor.Map2Object.cast(Map2Object.java:9)
at org.nutz.castor.Castors.cast(Castors.java:252)