MainModule配置如下
@Modules(scanPackage=true)
@IocBy(type=ComboIocProvider.class, args={"*js", "/ioc/",
"*anno", "net.wendal.nutzbook","com.lewen.controllers",
"*tx", // 事务拦截 aop
"*async", // 异步执行aop
"*quartz"}) // 添加了org.nutz.integration.quartz.QuartzIocLoader 这个预定义的集成配置
查看日志,com.lewen.controllers目录下的包被扫描到,但是URLmapping并没有识别到
2017-03-18 16:45:43,508 org.nutz.ioc.loader.json.JsonLoader.<init>(JsonLoader.java:56) DEBUG - Loaded 10 bean define from path=[/ioc/] --> [dao, emailAuthenticator, uploadFileContext, htmlEmail, tmpFilePool, uploadImageContext, conf, imageUpload, fileUpload, dataSource]
2017-03-18 16:45:43,527 org.nutz.resource.Scans.scan(Scans.java:274) DEBUG - Found 26 resource by src( net/wendal/nutzbook/ ) , regex( ^.+[.]class$ )
2017-03-18 16:45:43,575 org.nutz.ioc.loader.annotation.AnnotationIocLoader.addClass(AnnotationIocLoader.java:74) DEBUG - Found @IocBean : class net.wendal.nutzbook.demoModule.FormModule
2017-03-18 16:45:43,582 org.nutz.ioc.loader.annotation.AnnotationIocLoader.addClass(AnnotationIocLoader.java:74) DEBUG - Found @IocBean : class net.wendal.nutzbook.demoModule.webuploader
2017-03-18 16:45:43,593 org.nutz.ioc.loader.annotation.AnnotationIocLoader.addClass(AnnotationIocLoader.java:74) DEBUG - Found @IocBean : class net.wendal.nutzbook.module.AuthorityModule
2017-03-18 16:45:43,607 org.nutz.ioc.loader.annotation.AnnotationIocLoader.addClass(AnnotationIocLoader.java:74) DEBUG - Found @IocBean : class net.wendal.nutzbook.module.CaptchaModule
2017-03-18 16:45:43,612 org.nutz.ioc.loader.annotation.AnnotationIocLoader.addClass(AnnotationIocLoader.java:74) DEBUG - Found @IocBean : class net.wendal.nutzbook.module.UserModule
2017-03-18 16:45:43,626 org.nutz.ioc.loader.annotation.AnnotationIocLoader.addClass(AnnotationIocLoader.java:74) DEBUG - Found @IocBean : class net.wendal.nutzbook.module.UserProfileModule
2017-03-18 16:45:43,629 org.nutz.ioc.loader.annotation.AnnotationIocLoader.addClass(AnnotationIocLoader.java:74) DEBUG - Found @IocBean : class net.wendal.nutzbook.quartz.job.CleanNonActiveUserJob
2017-03-18 16:45:43,633 org.nutz.ioc.loader.annotation.AnnotationIocLoader.addClass(AnnotationIocLoader.java:74) DEBUG - Found @IocBean : class net.wendal.nutzbook.service.AuthorityServiceImpl
2017-03-18 16:45:43,634 org.nutz.ioc.loader.annotation.AnnotationIocLoader.addClass(AnnotationIocLoader.java:74) DEBUG - Found @IocBean : class net.wendal.nutzbook.service.EmailServiceImpl
2017-03-18 16:45:43,636 org.nutz.ioc.loader.annotation.AnnotationIocLoader.addClass(AnnotationIocLoader.java:74) DEBUG - Found @IocBean : class net.wendal.nutzbook.service.UserServiceImpl
2017-03-18 16:45:43,643 org.nutz.resource.Scans.scan(Scans.java:274) DEBUG - Found 2 resource by src( com/lewen/controllers/ ) , regex( ^.+[.]class$ )
2017-03-18 16:45:43,645 org.nutz.ioc.loader.annotation.AnnotationIocLoader.addClass(AnnotationIocLoader.java:74) DEBUG - Found @IocBean : class com.lewen.controllers.image.UploadController
2017-03-18 16:45:43,645 org.nutz.ioc.loader.annotation.AnnotationIocLoader.<init>(AnnotationIocLoader.java:50) INFO - Found 11 classes in 2 base-packages!
beans = ["cleanNonActiveUserJob", "userServiceImpl", "webuploader", "uploadController", "authorityService", "userProfileModule", "captchaModule", "authorityModule", "userModule", "formModule", "emailService"]
URLmapping日志里,com.lewen.controllers包下的入口方法,并没有被扫描到
2017-03-18 16:45:43,952 org.nutz.mvc.impl.UrlMappingImpl.print(UrlMappingImpl.java:146) DEBUG - '/user/login' >> (UserModule.java:55).login : Object | @Ok(json:{locked:'password|salt',ignoreNull:true}) @Fail(http:500) | by 0 Filters | (I:UTF-8/O:UTF-8)
2017-03-18 16:45:43,953 org.nutz.mvc.impl.UrlMappingImpl.print(UrlMappingImpl.java:146) DEBUG - '/user/login2' >> (UserModule.java:76).login2 : Object | @Ok(json:{locked:'password|salt',ignoreNull:true}) @Fail(http:500) | by 0 Filters | (I:UTF-8/O:UTF-8)
2017-03-18 16:45:43,955 org.nutz.mvc.impl.UrlMappingImpl.print(UrlMappingImpl.java:146) DEBUG - '/user/update2' >> (UserModule.java:168).update2 : Object | @Ok(json:{locked:'password|salt',ignoreNull:true}) @Fail(http:500) | by 0 Filters | (I:UTF-8/O:UTF-8)
2017-03-18 16:45:43,956 org.nutz.mvc.impl.NutLoading.evalUrlMapping(NutLoading.java:220) INFO - Found 36 module methods