2016-8-29 2:43:41 org.apache.catalina.core.AprLifecycleListener init
信息: The APR based Apache Tomcat Native library which allows optimal performance in production environments was not found on the java.library.path: E:\programming software\MyEclipce\binary\com.sun.java.jdk.win32.x86_64_1.6.0.u43\bin;E:\programming software\MyEclipce\plugins\com.genuitec.eclipse.easie.tomcat7.myeclipse_11.0.0.me201302261706\tomcat\bin
2016-8-29 2:43:41 org.apache.coyote.AbstractProtocol init
信息: Initializing ProtocolHandler ["http-bio-8080"]
2016-8-29 2:43:41 org.apache.coyote.AbstractProtocol init
信息: Initializing ProtocolHandler ["ajp-bio-8009"]
2016-8-29 2:43:41 org.apache.catalina.startup.Catalina load
信息: Initialization processed in 547 ms
2016-8-29 2:43:41 org.apache.catalina.core.StandardService startInternal
信息: Starting service Catalina
2016-8-29 2:43:41 org.apache.catalina.core.StandardEngine startInternal
信息: Starting Servlet Engine: Apache Tomcat/7.0.30
2016-8-29 2:43:41 org.apache.catalina.startup.HostConfig deployDirectory
信息: Deploying web application directory G:\Project.metadata.me_tcat7\webapps\nuz
ALL Nutz Log via Log4jLogAdapter
2016-08-29 02:43:42,394 [localhost-startStop-1] INFO org.nutz.log.Logs - Nutz is licensed under the Apache License, Version 2.0 .
Report bugs : https://github.com/nutzam/nutz/issues
2016-08-29 02:43:42,401 [localhost-startStop-1] INFO org.nutz.mvc.NutFilter - NutFilter[nutz] starting ...
2016-08-29 02:43:42,605 [localhost-startStop-1] DEBUG org.nutz.resource.Scans - Locations for Scans:
[JarResourceLocation [jarPath=E:\programming software\MyEclipce\binary\com.sun.java.jdk.win32.x86_64_1.6.0.u43\lib\tools.jar], FileSystemResourceLocation [root=G:\Project.metadata.me_tcat7\webapps\nuz\WEB-INF\classes], FileSystemResourceLocation [root=E:\programming software\MyEclipce\plugins\com.genuitec.eclipse.easie.tomcat7.myeclipse_11.0.0.me201302261706\tomcat\bin], JarResourceLocation [jarPath=E:\programming software\MyEclipce\plugins\com.genuitec.eclipse.easie.tomcat7.myeclipse_11.0.0.me201302261706\tomcat\bin\tomcat-juli.jar], JarResourceLocation [jarPath=G:\Project.metadata.me_tcat7\webapps\nuz\WEB-INF\lib\nutz-1.b.53.jar], JarResourceLocation [jarPath=E:\programming software\MyEclipce\plugins\com.genuitec.eclipse.easie.tomcat7.myeclipse_11.0.0.me201302261706\tomcat\bin\bootstrap.jar]]
2016-08-29 02:43:42,755 [localhost-startStop-1] DEBUG org.nutz.resource.Scans - Locations for Scans:
[JarResourceLocation [jarPath=G:\Project.metadata.me_tcat7\webapps\nuz\WEB-INF\lib\jstl.jar], JarResourceLocation [jarPath=G:\Project.metadata.me_tcat7\webapps\nuz\WEB-INF\lib\jstl-impl.jar], JarResourceLocation [jarPath=G:\Project.metadata.me_tcat7\webapps\nuz\WEB-INF\lib\log4j-1.2.16.jar], JarResourceLocation [jarPath=E:\programming software\MyEclipce\binary\com.sun.java.jdk.win32.x86_64_1.6.0.u43\lib\tools.jar], FileSystemResourceLocation [root=G:\Project.metadata.me_tcat7\webapps\nuz\WEB-INF\classes], FileSystemResourceLocation [root=E:\programming software\MyEclipce\plugins\com.genuitec.eclipse.easie.tomcat7.myeclipse_11.0.0.me201302261706\tomcat\bin], JarResourceLocation [jarPath=E:\programming software\MyEclipce\plugins\com.genuitec.eclipse.easie.tomcat7.myeclipse_11.0.0.me201302261706\tomcat\bin\tomcat-juli.jar], JarResourceLocation [jarPath=G:\Project.metadata.me_tcat7\webapps\nuz\WEB-INF\lib\druid-0.2.2.jar], JarResourceLocation [jarPath=G:\Project.metadata.me_tcat7\webapps\nuz\WEB-INF\lib\nutz-1.b.53.jar], JarResourceLocation [jarPath=E:\programming software\MyEclipce\plugins\com.genuitec.eclipse.easie.tomcat7.myeclipse_11.0.0.me201302261706\tomcat\bin\bootstrap.jar], JarResourceLocation [jarPath=G:\Project.metadata.me_tcat7\webapps\nuz\WEB-INF\lib\javax.servlet.jsp.jstl.jar], JarResourceLocation [jarPath=G:\Project.metadata.me_tcat7\webapps\nuz\WEB-INF\lib\mysql-connector-java-5.1.39-bin.jar]]
2016-08-29 02:43:42,766 [localhost-startStop-1] DEBUG org.nutz.mvc.config.AbstractNutConfig - MainModule: <com.parker.nutz.MainModule>
2016-08-29 02:43:42,787 [localhost-startStop-1] DEBUG org.nutz.mvc.config.AbstractNutConfig - Loading by class org.nutz.mvc.impl.NutLoading
2016-08-29 02:43:42,793 [localhost-startStop-1] INFO org.nutz.mvc.impl.NutLoading - Nutz Version : 1.b.53
2016-08-29 02:43:42,793 [localhost-startStop-1] INFO org.nutz.mvc.impl.NutLoading - Nutz.Mvc[nutz] is initializing ...
2016-08-29 02:43:42,793 [localhost-startStop-1] DEBUG org.nutz.mvc.impl.NutLoading - Web Container Information:
2016-08-29 02:43:42,795 [localhost-startStop-1] DEBUG org.nutz.mvc.impl.NutLoading - - Default Charset : GBK
2016-08-29 02:43:42,795 [localhost-startStop-1] DEBUG org.nutz.mvc.impl.NutLoading - - Current . path : E:\programming software\MyEclipce\plugins\com.genuitec.eclipse.easie.tomcat7.myeclipse_11.0.0.me201302261706\tomcat\bin.
2016-08-29 02:43:42,795 [localhost-startStop-1] DEBUG org.nutz.mvc.impl.NutLoading - - Java Version : 1.6.0_43
2016-08-29 02:43:42,795 [localhost-startStop-1] DEBUG org.nutz.mvc.impl.NutLoading - - File separator : \
2016-08-29 02:43:42,795 [localhost-startStop-1] DEBUG org.nutz.mvc.impl.NutLoading - - Timezone : Asia/Shanghai
2016-08-29 02:43:42,795 [localhost-startStop-1] DEBUG org.nutz.mvc.impl.NutLoading - - OS : Windows 8 amd64
2016-08-29 02:43:42,795 [localhost-startStop-1] DEBUG org.nutz.mvc.impl.NutLoading - - ServerInfo : Apache Tomcat/7.0.30
2016-08-29 02:43:42,795 [localhost-startStop-1] DEBUG org.nutz.mvc.impl.NutLoading - - Servlet API : 3.0
2016-08-29 02:43:42,795 [localhost-startStop-1] DEBUG org.nutz.mvc.impl.NutLoading - - ContextPath : /nuz
2016-08-29 02:43:42,797 [localhost-startStop-1] DEBUG org.nutz.mvc.config.AbstractNutConfig - MainModule: <com.parker.nutz.MainModule>
2016-08-29 02:43:42,797 [localhost-startStop-1] DEBUG org.nutz.mvc.impl.NutLoading - >> app.root = G:/Project/.metadata/.me_tcat7/webapps/nuz
2016-08-29 02:43:42,943 [localhost-startStop-1] DEBUG org.nutz.castor.Castors - Using 91 castor for Castors
2016-08-29 02:43:42,951 [localhost-startStop-1] DEBUG org.nutz.mvc.impl.NutLoading - @IocBy(type=org.nutz.mvc.ioc.provider.ComboIocProvider, args=["*org.nutz.ioc.loader.json.JsonLoader", "ioc/", "org.nutz.ioc.loader.annotation.AnnotationIocLoader", "com.parker.nutz", "*tx"],init=[])
2016-08-29 02:43:42,985 [localhost-startStop-1] DEBUG org.nutz.resource.Scans - Found 1 resource by src( ioc/ ) , regex( ^(.+[.])(js|json)$ )
2016-08-29 02:43:42,987 [localhost-startStop-1] DEBUG org.nutz.resource.Scans - Found 0 resource by src( org.nutz.ioc.loader.annotation.AnnotationIocLoader ) , regex( ^(.+[.])(js|json)$ )
2016-08-29 02:43:42,989 [localhost-startStop-1] DEBUG org.nutz.resource.Scans - Found 0 resource by src( com.parker.nutz ) , regex( ^(.+[.])(js|json)$ )
2016-08-29 02:43:42,989 [localhost-startStop-1] DEBUG org.nutz.ioc.loader.json.JsonLoader - loading ioc js config from [dao.js]
2016-08-29 02:43:42,999 [localhost-startStop-1] DEBUG org.nutz.ioc.loader.json.JsonLoader - Loaded 1 bean define from path=[ioc/, org.nutz.ioc.loader.annotation.AnnotationIocLoader, com.parker.nutz] --> [dataSource]
2016-08-29 02:43:43,003 [localhost-startStop-1] DEBUG org.nutz.ioc.loader.json.JsonLoader - Loaded 5 bean define from reader --
[txREPEATABLE_READ, txREAD_COMMITTED, txNONE, txSERIALIZABLE, txREAD_UNCOMMITTED]
2016-08-29 02:43:43,008 [localhost-startStop-1] INFO org.nutz.ioc.impl.NutIoc - NutIoc init begin ...
2016-08-29 02:43:43,013 [localhost-startStop-1] INFO org.nutz.ioc.impl.NutIoc - ... NutIoc init complete
2016-08-29 02:43:43,015 [localhost-startStop-1] DEBUG org.nutz.mvc.config.AbstractNutConfig - MainModule: <com.parker.nutz.MainModule>
2016-08-29 02:43:43,020 [localhost-startStop-1] INFO org.nutz.mvc.impl.NutLoading - Build URL mapping by org.nutz.mvc.impl.UrlMappingImpl ...
2016-08-29 02:43:43,024 [localhost-startStop-1] DEBUG org.nutz.mvc.impl.NutLoading - @Views(DefaultViewMaker)
2016-08-29 02:43:43,036 [localhost-startStop-1] DEBUG org.nutz.mvc.impl.NutLoading - @ChainBy(org.nutz.mvc.impl.NutActionChainMaker)
2016-08-29 02:43:43,048 [localhost-startStop-1] DEBUG org.nutz.mvc.impl.Loadings - module class location 'file:/G:/Project/.metadata/.me_tcat7/webapps/nuz/WEB-INF/classes/com/parker/nutz/MainModule.class'
2016-08-29 02:43:43,050 [localhost-startStop-1] DEBUG org.nutz.mvc.impl.Loadings - > scan 'com.parker.nutz'
2016-08-29 02:43:43,052 [localhost-startStop-1] DEBUG org.nutz.resource.Scans - Found 2 resource by src( com/parker/nutz/ ) , regex( ^.+[.]class$ )
2016-08-29 02:43:43,059 [localhost-startStop-1] DEBUG org.nutz.mvc.impl.Loadings - >> add 'com.parker.nutz.module.UserModule'
2016-08-29 02:43:43,075 [localhost-startStop-1] INFO org.nutz.mvc.impl.NutActionChainMaker - Optional processor class not found, disabled : org.nutz.integration.shiro.NutShiroProcessor
2016-08-29 02:43:43,084 [localhost-startStop-1] INFO org.nutz.mvc.impl.NutActionChainMaker - Optional processor class not found, disabled : org.nutz.plugins.validation.ValidationProcessor
2016-08-29 02:43:43,095 [localhost-startStop-1] DEBUG org.nutz.mvc.impl.UrlMappingImpl - '/ping' >> UserModule.ping(...) : Object | @Ok(json ) @Fail(json ) | by 0 Filters | (I:UTF-8/O:UTF-8)
2016-08-29 02:43:43,095 [localhost-startStop-1] INFO org.nutz.mvc.impl.NutLoading - Found 1 module methods
2016-08-29 02:43:43,097 [localhost-startStop-1] DEBUG org.nutz.mvc.impl.NutLoading - @Localization not define
2016-08-29 02:43:43,101 [localhost-startStop-1] INFO org.nutz.mvc.impl.NutLoading - Nutz.Mvc[nutz] is up in 304ms
2016-8-29 2:43:43 org.apache.coyote.AbstractProtocol start
信息: Starting ProtocolHandler ["http-bio-8080"]
2016-8-29 2:43:43 org.apache.coyote.AbstractProtocol start
信息: Starting ProtocolHandler ["ajp-bio-8009"]
2016-8-29 2:43:43 org.apache.catalina.startup.Catalina start
信息: Server startup in 1789 ms
2016-08-29 02:44:16,221 [http-bio-8080-exec-9] DEBUG org.nutz.mvc.impl.UrlMappingImpl - Found mapping for [GET] path=/ping : UserModule.ping(...)
2016-08-29 02:44:16,224 [http-bio-8080-exec-9] DEBUG org.nutz.ioc.impl.NutIoc - Get 'userModule'<class com.parker.nutz.module.UserModule>
2016-08-29 02:44:16,226 [http-bio-8080-exec-9] DEBUG org.nutz.ioc.impl.NutIoc - >> Load definition
2016-08-29 02:44:16,230 [http-bio-8080-exec-9] WARN org.nutz.mvc.impl.processor.FailProcessor - Error@/ping :
org.nutz.ioc.IocException: Object 'userModule' without define! For object [userModule] - type:[class com.parker.nutz.module.UserModule]
at org.nutz.ioc.impl.NutIoc.get(NutIoc.java:203)
at org.nutz.ioc.impl.NutIoc.get(NutIoc.java:221)
at org.nutz.mvc.impl.processor.ModuleProcessor.process(ModuleProcessor.java:106)
at org.nutz.mvc.impl.processor.AbstractProcessor.doNext(AbstractProcessor.java:44)
at org.nutz.mvc.impl.processor.EncodingProcessor.process(EncodingProcessor.java:27)
at org.nutz.mvc.impl.processor.AbstractProcessor.doNext(AbstractProcessor.java:44)
at org.nutz.mvc.impl.processor.UpdateRequestAttributesProcessor.process(UpdateRequestAttributesProcessor.java:15)
at org.nutz.mvc.impl.NutActionChain.doChain(NutActionChain.java:40)
at org.nutz.mvc.impl.ActionInvoker.invoke(ActionInvoker.java:67)
at org.nutz.mvc.ActionHandler.handle(ActionHandler.java:31)
at org.nutz.mvc.NutFilter.doFilter(NutFilter.java:183)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:222)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:123)
at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:472)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:168)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:99)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:118)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:407)
at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1002)
at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:585)
at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:312)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:895)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:918)
at java.lang.Thread.run(Thread.java:662)
Caused by: org.nutz.ioc.ObjectLoadException: Object 'userModule' without define!
at org.nutz.ioc.loader.combo.ComboIocLoader.load(ComboIocLoader.java:149)
at org.nutz.ioc.impl.NutIoc.get(NutIoc.java:168)
... 25 more
2016-08-29 02:44:18,876 [http-bio-8080-exec-9] DEBUG org.nutz.mvc.impl.UrlMappingImpl - Found mapping for [GET] path=/ping : UserModule.ping(...)
2016-08-29 02:44:18,877 [http-bio-8080-exec-9] DEBUG org.nutz.ioc.impl.NutIoc - Get 'userModule'<class com.parker.nutz.module.UserModule>
2016-08-29 02:44:18,877 [http-bio-8080-exec-9] DEBUG org.nutz.ioc.impl.NutIoc - >> Load definition
2016-08-29 02:44:18,877 [http-bio-8080-exec-9] WARN org.nutz.mvc.impl.processor.FailProcessor - Error@/ping :
org.nutz.ioc.IocException: Object 'userModule' without define! For object [userModule] - type:[class com.parker.nutz.module.UserModule]
at org.nutz.ioc.impl.NutIoc.get(NutIoc.java:203)
at org.nutz.ioc.impl.NutIoc.get(NutIoc.java:221)
at org.nutz.mvc.impl.processor.ModuleProcessor.process(ModuleProcessor.java:106)
at org.nutz.mvc.impl.processor.AbstractProcessor.doNext(AbstractProcessor.java:44)
at org.nutz.mvc.impl.processor.EncodingProcessor.process(EncodingProcessor.java:27)
at org.nutz.mvc.impl.processor.AbstractProcessor.doNext(AbstractProcessor.java:44)
at org.nutz.mvc.impl.processor.UpdateRequestAttributesProcessor.process(UpdateRequestAttributesProcessor.java:15)
at org.nutz.mvc.impl.NutActionChain.doChain(NutActionChain.java:40)
at org.nutz.mvc.impl.ActionInvoker.invoke(ActionInvoker.java:67)
at org.nutz.mvc.ActionHandler.handle(ActionHandler.java:31)
at org.nutz.mvc.NutFilter.doFilter(NutFilter.java:183)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:222)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:123)
at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:472)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:168)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:99)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:118)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:407)
at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1002)
at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:585)
at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:312)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:895)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:918)
at java.lang.Thread.run(Thread.java:662)
Caused by: org.nutz.ioc.ObjectLoadException: Object 'userModule' without define!
at org.nutz.ioc.loader.combo.ComboIocLoader.load(ComboIocLoader.java:149)
at org.nutz.ioc.impl.NutIoc.get(NutIoc.java:168)
... 25 more
2016-08-29 02:44:35,110 [http-bio-8080-exec-5] DEBUG org.nutz.mvc.impl.UrlMappingImpl - Found mapping for [GET] path=/ping : UserModule.ping(...)
2016-08-29 02:44:35,111 [http-bio-8080-exec-5] DEBUG org.nutz.ioc.impl.NutIoc - Get 'userModule'<class com.parker.nutz.module.UserModule>
2016-08-29 02:44:35,111 [http-bio-8080-exec-5] DEBUG org.nutz.ioc.impl.NutIoc - >> Load definition
2016-08-29 02:44:35,111 [http-bio-8080-exec-5] WARN org.nutz.mvc.impl.processor.FailProcessor - Error@/ping :
org.nutz.ioc.IocException: Object 'userModule' without define! For object [userModule] - type:[class com.parker.nutz.module.UserModule]
at org.nutz.ioc.impl.NutIoc.get(NutIoc.java:203)
at org.nutz.ioc.impl.NutIoc.get(NutIoc.java:221)
at org.nutz.mvc.impl.processor.ModuleProcessor.process(ModuleProcessor.java:106)
at org.nutz.mvc.impl.processor.AbstractProcessor.doNext(AbstractProcessor.java:44)
at org.nutz.mvc.impl.processor.EncodingProcessor.process(EncodingProcessor.java:27)
at org.nutz.mvc.impl.processor.AbstractProcessor.doNext(AbstractProcessor.java:44)
at org.nutz.mvc.impl.processor.UpdateRequestAttributesProcessor.process(UpdateRequestAttributesProcessor.java:15)
at org.nutz.mvc.impl.NutActionChain.doChain(NutActionChain.java:40)
at org.nutz.mvc.impl.ActionInvoker.invoke(ActionInvoker.java:67)
at org.nutz.mvc.ActionHandler.handle(ActionHandler.java:31)
at org.nutz.mvc.NutFilter.doFilter(NutFilter.java:183)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:222)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:123)
at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:472)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:168)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:99)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:118)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:407)
at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1002)
at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:585)
at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:312)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:895)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:918)
at java.lang.Thread.run(Thread.java:662)
Caused by: org.nutz.ioc.ObjectLoadException: Object 'userModule' without define!
at org.nutz.ioc.loader.combo.ComboIocLoader.load(ComboIocLoader.java:149)
at org.nutz.ioc.impl.NutIoc.get(NutIoc.java:168)
... 25 more
web.xml
<?xml version="1.0" encoding="UTF-8"?>
<web-app version="2.5"
xmlns="http://java.sun.com/xml/ns/javaee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee
http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"
nutz
org.nutz.mvc.NutFilter
modules
com.parker.nutz.MainModule
nutz
/*
一、dao.js
var ioc = {
dataSource : {
type : "com.alibaba.druid.pool.DruidDataSource",
fields : {
driverClassName : 'com.mysql.jdbc.Driver',
url : 'jdbc:mysql://localhost:3306/test',
username : 'root',
password : '1234'
},
dao : {
type : "org.nutz.dao.impl.NutDao",
args : [ {
refer : "dataSource"
} ]
}
}
};
二、MainModule.java
package com.parker.nutz;
import org.nutz.mvc.annotation.Fail;
import org.nutz.mvc.annotation.IocBy;
import org.nutz.mvc.annotation.Modules;
import org.nutz.mvc.annotation.Ok;
import org.nutz.mvc.annotation.SetupBy;
import org.nutz.mvc.ioc.provider.ComboIocProvider;
@Modules(scanPackage=true)
@Ok("json")
@Fail("json")
@IocBy(type=ComboIocProvider.class,
args={"*org.nutz.ioc.loader.json.JsonLoader",
"ioc/",
"org.nutz.ioc.loader.annotation.AnnotationIocLoader",
"com.parker.nutz","*tx"})
public class MainModule {
}
三、UserModule.java
package com.parker.nutz.module;
import java.util.Date;
import org.nutz.dao.Dao;
import org.nutz.ioc.annotation.InjectName;
import org.nutz.ioc.loader.annotation.Inject;
import org.nutz.ioc.loader.annotation.IocBean;
import org.nutz.mvc.annotation.At;
@IocBean
@InjectName("userModule")
public class UserModule {
@Inject
private Dao dao;
@At("/ping")
public Object ping() {
return new Date();
}
}