九月 07, 2017 3:15:42 下午 org.apache.catalina.startup.VersionLoggerListener log
信息: Server version: Apache Tomcat/8.0.30
九月 07, 2017 3:15:42 下午 org.apache.catalina.startup.VersionLoggerListener log
信息: Server built: Dec 1 2015 22:30:46 UTC
九月 07, 2017 3:15:42 下午 org.apache.catalina.startup.VersionLoggerListener log
信息: Server number: 8.0.30.0
九月 07, 2017 3:15:42 下午 org.apache.catalina.startup.VersionLoggerListener log
信息: OS Name: Windows 7
九月 07, 2017 3:15:42 下午 org.apache.catalina.startup.VersionLoggerListener log
信息: OS Version: 6.1
九月 07, 2017 3:15:42 下午 org.apache.catalina.startup.VersionLoggerListener log
信息: Architecture: amd64
九月 07, 2017 3:15:42 下午 org.apache.catalina.startup.VersionLoggerListener log
信息: Java Home: C:\Program Files\Java\jdk1.7.0_79\jre
九月 07, 2017 3:15:42 下午 org.apache.catalina.startup.VersionLoggerListener log
信息: JVM Version: 1.7.0_79-b15
九月 07, 2017 3:15:42 下午 org.apache.catalina.startup.VersionLoggerListener log
信息: JVM Vendor: Oracle Corporation
九月 07, 2017 3:15:42 下午 org.apache.catalina.startup.VersionLoggerListener log
信息: CATALINA_BASE: D:\MyEclipse\apache-tomcat-8.0.30
九月 07, 2017 3:15:42 下午 org.apache.catalina.startup.VersionLoggerListener log
信息: CATALINA_HOME: D:\MyEclipse\apache-tomcat-8.0.30
九月 07, 2017 3:15:42 下午 org.apache.catalina.startup.VersionLoggerListener log
信息: Command line argument: -Dcatalina.home=D:\MyEclipse\apache-tomcat-8.0.30
九月 07, 2017 3:15:42 下午 org.apache.catalina.startup.VersionLoggerListener log
信息: Command line argument: -Dcatalina.base=D:\MyEclipse\apache-tomcat-8.0.30
九月 07, 2017 3:15:42 下午 org.apache.catalina.startup.VersionLoggerListener log
信息: Command line argument: -Djava.endorsed.dirs=D:\MyEclipse\apache-tomcat-8.0.30/common/endorsed
九月 07, 2017 3:15:42 下午 org.apache.catalina.startup.VersionLoggerListener log
信息: Command line argument: -Djava.io.tmpdir=D:\MyEclipse\apache-tomcat-8.0.30\temp
九月 07, 2017 3:15:42 下午 org.apache.catalina.startup.VersionLoggerListener log
信息: Command line argument: -Djava.library.path=C:\Program Files\Java\jdk1.7.0_79\bin;D:\MyEclipse\apache-tomcat-8.0.30\bin
九月 07, 2017 3:15:42 下午 org.apache.catalina.startup.VersionLoggerListener log
信息: Command line argument: -Dsun.io.useCanonCaches=false
九月 07, 2017 3:15:42 下午 org.apache.catalina.core.AprLifecycleListener lifecycleEvent
信息: Loaded APR based Apache Tomcat Native library 1.1.33 using APR version 1.5.1.
九月 07, 2017 3:15:42 下午 org.apache.catalina.core.AprLifecycleListener lifecycleEvent
信息: APR capabilities: IPv6 [true], sendfile [true], accept filters [false], random [true].
九月 07, 2017 3:15:43 下午 org.apache.catalina.core.AprLifecycleListener initializeSSL
信息: OpenSSL successfully initialized (OpenSSL 1.0.1m 19 Mar 2015)
九月 07, 2017 3:15:43 下午 org.apache.coyote.AbstractProtocol init
信息: Initializing ProtocolHandler ["http-apr-8081"]
九月 07, 2017 3:15:43 下午 org.apache.coyote.AbstractProtocol init
信息: Initializing ProtocolHandler ["ajp-apr-8009"]
九月 07, 2017 3:15:43 下午 org.apache.catalina.startup.Catalina load
信息: Initialization processed in 1395 ms
九月 07, 2017 3:15:43 下午 org.apache.catalina.core.StandardService startInternal
信息: Starting service Catalina
九月 07, 2017 3:15:43 下午 org.apache.catalina.core.StandardEngine startInternal
信息: Starting Servlet Engine: Apache Tomcat/8.0.30
九月 07, 2017 3:15:43 下午 org.apache.catalina.startup.HostConfig deployDirectory
信息: Deploying web application directory D:\MyEclipse\apache-tomcat-8.0.30\webapps\docs
九月 07, 2017 3:15:44 下午 org.apache.catalina.util.SessionIdGeneratorBase createSecureRandom
信息: Creation of SecureRandom instance for session ID generation using [SHA1PRNG] took [765] milliseconds.
九月 07, 2017 3:15:44 下午 org.apache.catalina.startup.HostConfig deployDirectory
信息: Deployment of web application directory D:\MyEclipse\apache-tomcat-8.0.30\webapps\docs has finished in 1,179 ms
九月 07, 2017 3:15:44 下午 org.apache.catalina.startup.HostConfig deployDirectory
信息: Deploying web application directory D:\MyEclipse\apache-tomcat-8.0.30\webapps\examples
九月 07, 2017 3:15:45 下午 org.apache.catalina.core.ApplicationContext log
信息: ContextListener: contextInitialized()
九月 07, 2017 3:15:45 下午 org.apache.catalina.core.ApplicationContext log
信息: SessionListener: contextInitialized()
九月 07, 2017 3:15:45 下午 org.apache.catalina.startup.HostConfig deployDirectory
信息: Deployment of web application directory D:\MyEclipse\apache-tomcat-8.0.30\webapps\examples has finished in 380 ms
九月 07, 2017 3:15:45 下午 org.apache.catalina.startup.HostConfig deployDirectory
信息: Deploying web application directory D:\MyEclipse\apache-tomcat-8.0.30\webapps\host-manager
九月 07, 2017 3:15:45 下午 org.apache.catalina.startup.HostConfig deployDirectory
信息: Deployment of web application directory D:\MyEclipse\apache-tomcat-8.0.30\webapps\host-manager has finished in 35 ms
九月 07, 2017 3:15:45 下午 org.apache.catalina.startup.HostConfig deployDirectory
信息: Deploying web application directory D:\MyEclipse\apache-tomcat-8.0.30\webapps\manager
九月 07, 2017 3:15:45 下午 org.apache.catalina.startup.HostConfig deployDirectory
信息: Deployment of web application directory D:\MyEclipse\apache-tomcat-8.0.30\webapps\manager has finished in 33 ms
九月 07, 2017 3:15:45 下午 org.apache.catalina.startup.HostConfig deployDirectory
信息: Deploying web application directory D:\MyEclipse\apache-tomcat-8.0.30\webapps\nutzbook
九月 07, 2017 3:15:45 下午 org.apache.jasper.servlet.TldScanner scanJars
信息: At least one JAR was scanned for TLDs yet contained no TLDs. Enable debug logging for this logger for a complete list of JARs that were scanned but no TLDs were found in them. Skipping unneeded JARs during scanning can improve startup time and JSP compilation time.
17-09-07 15:15:45.789 INFO [localhost-startStop-1] Select SystemLog as Nutz.Log implement
17-09-07 15:15:45.796 INFO [localhost-startStop-1] NutFilter[nutz] starting ...
17-09-07 15:15:45.812 DEBUG [localhost-startStop-1] Locations count=4 time use 7ms
17-09-07 15:15:45.817 DEBUG [localhost-startStop-1] Locations count=8 time use 5ms
17-09-07 15:15:45.883 DEBUG [localhost-startStop-1] Using 95 castor for Castors
17-09-07 15:15:45.895 DEBUG [localhost-startStop-1] Loading by class org.nutz.mvc.impl.NutLoading
17-09-07 15:15:45.897 INFO [localhost-startStop-1] Nutz Version : 1.r.62
17-09-07 15:15:45.898 INFO [localhost-startStop-1] Nutz.Mvc[nutz] is initializing ...
17-09-07 15:15:45.898 DEBUG [localhost-startStop-1] Web Container Information:
17-09-07 15:15:45.899 DEBUG [localhost-startStop-1] - Default Charset : GBK
17-09-07 15:15:45.899 DEBUG [localhost-startStop-1] - Current . path : D:\MyEclipse\apache-tomcat-8.0.30\bin\.
17-09-07 15:15:45.900 DEBUG [localhost-startStop-1] - Java Version : 1.7.0_79
17-09-07 15:15:45.900 DEBUG [localhost-startStop-1] - File separator : \
17-09-07 15:15:45.900 DEBUG [localhost-startStop-1] - Timezone : Asia/Shanghai
17-09-07 15:15:45.900 DEBUG [localhost-startStop-1] - OS : Windows 7 amd64
17-09-07 15:15:45.901 DEBUG [localhost-startStop-1] - ServerInfo : Apache Tomcat/8.0.30
17-09-07 15:15:45.901 DEBUG [localhost-startStop-1] - Servlet API : 3.1
17-09-07 15:15:45.901 DEBUG [localhost-startStop-1] - ContextPath : /nutzbook
17-09-07 15:15:45.901 DEBUG [localhost-startStop-1] - context.tempdir : D:\MyEclipse\apache-tomcat-8.0.30\work\Catalina\localhost\nutzbook
17-09-07 15:15:45.902 DEBUG [localhost-startStop-1] - MainModule : net.wendal.nutzbook.MainModule
17-09-07 15:15:45.902 DEBUG [localhost-startStop-1] >> app.root = D:/MyEclipse/apache-tomcat-8.0.30/webapps/nutzbook
17-09-07 15:15:45.906 DEBUG [localhost-startStop-1] @IocBy(type=org.nutz.mvc.ioc.provider.ComboIocProvider, args=["*js", "ioc/", "*anno", "net.wendal.nutzbook", "*tx", "*async"],init=[])
17-09-07 15:15:45.963 DEBUG [localhost-startStop-1] Found 1 resource by src( ioc/ ) , regex( ^(.+[.])(js|json)$ )
17-09-07 15:15:45.964 DEBUG [localhost-startStop-1] loading [dao.js]
17-09-07 15:15:45.970 DEBUG [localhost-startStop-1] Loaded 2 bean define from path=[ioc/] --> [dataSource, dao]
17-09-07 15:15:45.979 DEBUG [localhost-startStop-1] Found 4 resource by src( net/wendal/nutzbook/ ) , regex( ^.+[.]class$ )
17-09-07 15:15:45.997 DEBUG [localhost-startStop-1] Found @IocBean : class net.wendal.nutzbook.module.UserModule
17-09-07 15:15:46.006 INFO [localhost-startStop-1] Found 1 classes in 1 base-packages!
beans = ["userModule"]
17-09-07 15:15:46.012 DEBUG [localhost-startStop-1] Loaded 5 bean define from reader --
[txREPEATABLE_READ, txREAD_COMMITTED, txNONE, txSERIALIZABLE, txREAD_UNCOMMITTED]
17-09-07 15:15:46.031 DEBUG [localhost-startStop-1] Load AopConfigure for anno=org.nutz.aop.interceptor.async.Async by type=org.nutz.aop.interceptor.async.AsyncAopIocLoader
17-09-07 15:15:46.033 INFO [localhost-startStop-1] NutIoc init begin ...
17-09-07 15:15:46.036 INFO [localhost-startStop-1] ... NutIoc init complete
17-09-07 15:15:46.039 INFO [localhost-startStop-1] Build URL mapping by org.nutz.mvc.impl.UrlMappingImpl ...
17-09-07 15:15:46.041 DEBUG [localhost-startStop-1] @Views(DefaultViewMaker.class)
17-09-07 15:15:46.047 DEBUG [localhost-startStop-1] @ChainBy(org.nutz.mvc.impl.NutActionChainMaker)
17-09-07 15:15:46.053 DEBUG [localhost-startStop-1] module class location 'file:/D:/MyEclipse/apache-tomcat-8.0.30/webapps/nutzbook/WEB-INF/classes/'
17-09-07 15:15:46.053 DEBUG [localhost-startStop-1] > scan 'net.wendal.nutzbook'
17-09-07 15:15:46.055 DEBUG [localhost-startStop-1] Found 4 resource by src( net/wendal/nutzbook/ ) , regex( ^.+[.]class$ )
17-09-07 15:15:46.056 DEBUG [localhost-startStop-1] >> add 'net.wendal.nutzbook.module.UserModule'
17-09-07 15:15:46.076 INFO [localhost-startStop-1] Optional processor class not found, disabled : org.nutz.integration.shiro.NutShiroProcessor
17-09-07 15:15:46.111 INFO [localhost-startStop-1] Optional processor class not found, disabled : org.nutz.plugins.validation.ValidationProcessor
17-09-07 15:15:46.186 DEBUG [localhost-startStop-1] '/user/add' >> (UserModule.java:66).add : Object | @Ok(json:{locked:'password|salt',ignoreNull:true}) @Fail(http:500) | by 1 Filters | (I:UTF-8/O:UTF-8)
17-09-07 15:15:46.188 DEBUG [localhost-startStop-1] '/user/count' >> (UserModule.java:38).count : int | @Ok(json:{locked:'password|salt',ignoreNull:true}) @Fail(http:500) | by 1 Filters | (I:UTF-8/O:UTF-8)
17-09-07 15:15:46.190 DEBUG [localhost-startStop-1] '/user/' >> (UserModule.java:113).index : void | @Ok(jsp:jsp.user.list) @Fail(http:500) | by 1 Filters | (I:UTF-8/O:UTF-8)
17-09-07 15:15:46.195 DEBUG [localhost-startStop-1] '/user/delete' >> (UserModule.java:94).delete : Object | @Ok(json:{locked:'password|salt',ignoreNull:true}) @Fail(http:500) | by 1 Filters | (I:UTF-8/O:UTF-8)
17-09-07 15:15:46.196 DEBUG [localhost-startStop-1] '/user/update' >> (UserModule.java:79).update : Object | @Ok(json:{locked:'password|salt',ignoreNull:true}) @Fail(http:500) | by 1 Filters | (I:UTF-8/O:UTF-8)
17-09-07 15:15:46.198 DEBUG [localhost-startStop-1] '/user/login' >> (UserModule.java:45).login : Object | @Ok(json:{locked:'password|salt',ignoreNull:true}) @Fail(http:500) | by 0 Filters | (I:UTF-8/O:UTF-8)
17-09-07 15:15:46.200 DEBUG [localhost-startStop-1] '/user/logout' >> (UserModule.java:59).logout : void | @Ok(>>:/ ) @Fail(http:500) | by 1 Filters | (I:UTF-8/O:UTF-8)
17-09-07 15:15:46.200 INFO [localhost-startStop-1] Found 7 module methods
17-09-07 15:15:46.201 DEBUG [localhost-startStop-1] @Localization not define
17-09-07 15:15:46.201 INFO [localhost-startStop-1] Setup application...
17-09-07 15:15:46.205 DEBUG [localhost-startStop-1] Get 'dao'<interface org.nutz.dao.Dao>
17-09-07 15:15:46.205 DEBUG [localhost-startStop-1] Get '$aop_async'<interface org.nutz.ioc.aop.config.AopConfigration>
17-09-07 15:15:46.206 DEBUG [localhost-startStop-1] >> Load definition name=$aop_async
17-09-07 15:15:46.208 DEBUG [localhost-startStop-1] Found IocObject($aop_async) in AsyncAopIocLoader@167902352
17-09-07 15:15:46.208 DEBUG [localhost-startStop-1] >> Make...'$aop_async'<interface org.nutz.ioc.aop.config.AopConfigration>
17-09-07 15:15:46.209 DEBUG [localhost-startStop-1] Save object '$aop_async' to [app]
17-09-07 15:15:46.214 DEBUG [localhost-startStop-1] Load AopConfigure for anno=org.nutz.ioc.aop.Aop by type=org.nutz.ioc.aop.config.impl.AnnotationAopConfigration
17-09-07 15:15:46.214 DEBUG [localhost-startStop-1] >> Load definition name=dao
17-09-07 15:15:46.214 DEBUG [localhost-startStop-1] Loading define for name=dao
17-09-07 15:15:46.217 DEBUG [localhost-startStop-1] Found IocObject(dao) in JsonLoader(paths=[ioc/])
17-09-07 15:15:46.217 DEBUG [localhost-startStop-1] >> Make...'dao'<interface org.nutz.dao.Dao>
17-09-07 15:15:46.229 DEBUG [localhost-startStop-1] Load class org.nutz.dao.impl.NutDao without AOP
17-09-07 15:15:46.230 DEBUG [localhost-startStop-1] Save object 'dao' to [app]
17-09-07 15:15:46.231 DEBUG [localhost-startStop-1] Get 'dataSource'<>
17-09-07 15:15:46.231 DEBUG [localhost-startStop-1] >> Load definition name=dataSource
17-09-07 15:15:46.231 DEBUG [localhost-startStop-1] Loading define for name=dataSource
17-09-07 15:15:46.242 DEBUG [localhost-startStop-1] Found IocObject(dataSource) in JsonLoader(paths=[ioc/])
17-09-07 15:15:46.243 DEBUG [localhost-startStop-1] >> Make...'dataSource'<>
17-09-07 15:15:46.262 DEBUG [localhost-startStop-1] Load class com.alibaba.druid.pool.DruidDataSource without AOP
17-09-07 15:15:46.262 DEBUG [localhost-startStop-1] Save object 'dataSource' to [app]
九月 07, 2017 3:15:46 下午 com.alibaba.druid.pool.DruidDataSource info
信息: {dataSource-1} inited
17-09-07 15:15:46.571 DEBUG [localhost-startStop-1] Get 'dataSource'<>
17-09-07 15:15:46.788 DEBUG [localhost-startStop-1] Jdbcs init complete
17-09-07 15:15:46.788 INFO [localhost-startStop-1] Get Connection from DataSource for JdbcExpert, if you lock at here, check your database server and configure
17-09-07 15:15:46.998 DEBUG [localhost-startStop-1] select expert : org.nutz.dao.impl.jdbc.mysql.MysqlJdbcExpert
17-09-07 15:15:47.006 DEBUG [localhost-startStop-1] JDBC Driver --> mysql-connector-java-5.1.34 ( Revision: jess.balint@oracle.com-20141014163213-wqbwpf1ok2kvo1om )
17-09-07 15:15:47.006 DEBUG [localhost-startStop-1] JDBC Name --> MySQL Connector Java
17-09-07 15:15:47.007 DEBUG [localhost-startStop-1] JDBC URL --> jdbc:mysql://127.0.0.1:3306/nutzbook
17-09-07 15:15:47.017 DEBUG [localhost-startStop-1] Mysql : character_set_client=utf8
17-09-07 15:15:47.018 DEBUG [localhost-startStop-1] Mysql : character_set_connection=utf8
17-09-07 15:15:47.018 DEBUG [localhost-startStop-1] Mysql : character_set_database=utf8
17-09-07 15:15:47.018 DEBUG [localhost-startStop-1] Mysql : character_set_filesystem=binary
17-09-07 15:15:47.019 DEBUG [localhost-startStop-1] Mysql : character_set_results=
17-09-07 15:15:47.019 DEBUG [localhost-startStop-1] Mysql : character_set_server=utf8
17-09-07 15:15:47.019 DEBUG [localhost-startStop-1] Mysql : character_set_system=utf8
17-09-07 15:15:47.020 DEBUG [localhost-startStop-1] Mysql : character_sets_dir=C:\Program Files\MySQL\MySQL Server 5.7\share\charsets\
17-09-07 15:15:47.022 DEBUG [localhost-startStop-1] Mysql : binlog_format=ROW
17-09-07 15:15:47.023 DEBUG [localhost-startStop-1] Mysql : database=nutzbook
17-09-07 15:15:47.024 DEBUG [localhost-startStop-1] Mysql : user=root@localhost
17-09-07 15:15:47.037 DEBUG [localhost-startStop-1] Database info --> MYSQL:[MySQL - 5.7.17-log]
17-09-07 15:15:47.042 DEBUG [localhost-startStop-1] Found 4 resource by src( net/wendal/nutzbook/ ) , regex( ^.+[.]class$ )
17-09-07 15:15:47.077 DEBUG [localhost-startStop-1] SELECT COUNT(*) FROM t_user
17-09-07 15:15:47.079 INFO [localhost-startStop-1] Nutz.Mvc[nutz] is up in 1177ms
九月 07, 2017 3:15:47 下午 org.apache.catalina.startup.HostConfig deployDirectory
信息: Deployment of web application directory D:\MyEclipse\apache-tomcat-8.0.30\webapps\nutzbook has finished in 1,942 ms
九月 07, 2017 3:15:47 下午 org.apache.catalina.startup.HostConfig deployDirectory
信息: Deploying web application directory D:\MyEclipse\apache-tomcat-8.0.30\webapps\ROOT
九月 07, 2017 3:15:47 下午 org.apache.catalina.startup.HostConfig deployDirectory
信息: Deployment of web application directory D:\MyEclipse\apache-tomcat-8.0.30\webapps\ROOT has finished in 23 ms
九月 07, 2017 3:15:47 下午 org.apache.coyote.AbstractProtocol start
信息: Starting ProtocolHandler ["http-apr-8081"]
九月 07, 2017 3:15:47 下午 org.apache.coyote.AbstractProtocol start
信息: Starting ProtocolHandler ["ajp-apr-8009"]
九月 07, 2017 3:15:47 下午 org.apache.catalina.startup.Catalina start
信息: Server startup in 3650 ms
17-09-07 15:15:50.603 DEBUG [http-apr-8081-exec-2] Search mapping for [GET] path=/user/query : NOT Action match
17-09-07 15:15:51.968 DEBUG [http-apr-8081-exec-4] Search mapping for [GET] path=/user/query : NOT Action match
17-09-07 15:15:53.915 DEBUG [http-apr-8081-exec-6] Search mapping for [GET] path=/user/query : NOT Action match
17-09-07 15:15:56.348 DEBUG [http-apr-8081-exec-7] Search mapping for [GET] path=/user/query : NOT Action match
17-09-07 15:16:00.882 DEBUG [http-apr-8081-exec-8] Search mapping for [GET] path=/user/query : NOT Action match
17-09-07 15:16:55.111 DEBUG [http-apr-8081-exec-2] Search mapping for [GET] path= : NOT Action match
17-09-07 15:16:59.175 DEBUG [http-apr-8081-exec-6] Found mapping for [GET] path=/user : UserModule.index(UserModule.java:113)
17-09-07 15:16:59.181 DEBUG [http-apr-8081-exec-6] Get 'userModule'<class net.wendal.nutzbook.module.UserModule>
17-09-07 15:16:59.182 DEBUG [http-apr-8081-exec-6] >> Load definition name=userModule
17-09-07 15:16:59.183 DEBUG [http-apr-8081-exec-6] Found IocObject(userModule) in AnnotationIocLoader(packages=[net.wendal.nutzbook])
17-09-07 15:16:59.184 DEBUG [http-apr-8081-exec-6] >> Make...'userModule'<class net.wendal.nutzbook.module.UserModule>
17-09-07 15:16:59.186 DEBUG [http-apr-8081-exec-6] Load class net.wendal.nutzbook.module.UserModule without AOP
17-09-07 15:16:59.187 DEBUG [http-apr-8081-exec-6] Save object 'userModule' to [app]
17-09-07 15:16:59.196 DEBUG [http-apr-8081-exec-6] Get 'dao'<interface org.nutz.dao.Dao>
17-09-07 15:17:11.524 DEBUG [http-apr-8081-exec-10] Search mapping for [GET] path=/user/query : NOT Action match
17-09-07 15:20:30.764 DEBUG [http-apr-8081-exec-3] Found mapping for [GET] path=/user/add : UserModule.add(UserModule.java:66)
17-09-07 15:20:30.766 DEBUG [http-apr-8081-exec-3] Get 'userModule'<class net.wendal.nutzbook.module.UserModule>
17-09-07 15:20:32.695 DEBUG [http-apr-8081-exec-2] Found mapping for [POST] path=/user/login : UserModule.login(UserModule.java:45)
17-09-07 15:20:32.696 DEBUG [http-apr-8081-exec-2] Get 'userModule'<class net.wendal.nutzbook.module.UserModule>
17-09-07 15:20:32.771 DEBUG [http-apr-8081-exec-2] SELECT * FROM t_user WHERE name=? AND passwd=? LIMIT 0, 1
| 1 | 2 |
|-------|--------|
| admin | 123456 |
For example:> "SELECT * FROM t_user WHERE name='admin' AND passwd='123456' LIMIT 0, 1 "
17-09-07 15:21:00.550 DEBUG [http-apr-8081-exec-7] Found mapping for [GET] path=/user/logout : UserModule.logout(UserModule.java:59)
17-09-07 15:21:00.551 DEBUG [http-apr-8081-exec-7] Get 'userModule'<class net.wendal.nutzbook.module.UserModule>
17-09-07 15:21:18.375 DEBUG [http-apr-8081-exec-10] Search mapping for [GET] path=/user/query : NOT Action match
这是日志
package net.wendal.nutzbook.module;
import java.util.Date;
import javax.servlet.http.HttpSession;
import net.wendal.nutzbook.bean.User;
import org.nutz.dao.Cnd;
import org.nutz.dao.Dao;
import org.nutz.dao.QueryResult;
import org.nutz.dao.pager.Pager;
import org.nutz.ioc.loader.annotation.Inject;
import org.nutz.ioc.loader.annotation.IocBean;
import org.nutz.lang.Strings;
import org.nutz.lang.util.NutMap;
import org.nutz.mvc.annotation.At;
import org.nutz.mvc.annotation.Attr;
import org.nutz.mvc.annotation.By;
import org.nutz.mvc.annotation.Fail;
import org.nutz.mvc.annotation.Filters;
import org.nutz.mvc.annotation.Ok;
import org.nutz.mvc.annotation.Param;
import org.nutz.mvc.filter.CheckSession;
@IocBean// 声明为Ioc容器中的一个Bean
@At("/user")// 整个模块的路径前缀
@Ok("json:{locked:'password|salt',ignoreNull:true}")//忽略password和salt属性,忽略空属性的json输出
@Fail("http:500")// 抛出异常的话,就走500页面
@Filters(@By(type=CheckSession.class,args={"me","/"}))//检查当前Session是否带me这个属性
//含义是,如果当前Session没有带me这个attr,就跳转到/页面,即首页.
//同时,为login方法设置为空的过滤器,不然就没法登陆了
public class UserModule {
@Inject// 注入同名的一个ioc对象
protected Dao dao;
@At
public int count(){// 统计用户数的方法,算是个测试点
return dao.count(User.class);
}
@At
@Filters//覆盖UserModule类的@Filter设置,因为登陆可不能要求是个已经登陆的Session
public Object login(@Param("username")String name,
@Param("password")String password,
HttpSession session){
User user =dao.fetch(User.class,
Cnd.where("name","=",name).and("password","=",password));
if(user == null){
return false;
}else {
session.setAttribute("me", user.getId());
return true;
}
}
@At
@Ok(">>:/")
// >> 和 -> 分别是 redirect 和 forward的缩写.
//>>:XXX 即302重定向,不要使用->:XXX内部重定向, 因为后者在shiro环境下会报错
public void logout(HttpSession session){
session.invalidate();
}
//增
@At
public Object add(@Param("..")User user){// 两个点号是按对象属性一一设置
//假设客户端通过表单把新建用户的属性都发过来了
NutMap re =new NutMap();
String msg =checkUser(user, true);
if(msg != null){
return re.setv("ok", false).setv("msg", msg);
}
user.setCreateTime(new Date());
user.setUpdateTime(new Date());
user=dao.insert(user);
return re.setv("ok",true).setv("data",user);
}
//改
@At
public Object update(@Param("..")User user){
NutMap re = new NutMap();
String msg = checkUser(user, false);
if(msg!=null){
return re.setv("ok", false).setv("msg", msg);
}
user.setName(null);//不允许更新用户名
user.setCreateTime(null);//不允许更新创建时间
user.setUpdateTime(new Date());//设置正确的更新时间
dao.update(user);//真正更新的只有password和salt
return re.setv("ok", true);
}
//删
@At
//其中的@Attr是取Session/Request中的me属性.
public Object delete(@Param("id")int id,@Attr("me")int me){
if(me == id){
return new NutMap().setv("ok", false).setv("msg", "不能删除当前用户");
}
dao.delete(User.class,id);//需要判断是否为0
return new NutMap().setv("ok", true);
}
//查
public Object query(@Param("name")String name,
@Param("..")Pager pager){
Cnd cnd = Strings.isBlank(name) ? null : Cnd.where("name","like","%"+name+"%");
QueryResult qr = new QueryResult();
qr.setList(dao.query(User.class, cnd,pager));
pager.setRecordCount(dao.count(User.class,cnd));
qr.setPager(pager);
return qr;//默认分页是第一条,每页20条
}
@At("/")
@Ok("jsp:jsp.user.list") // 真实路径是 /WEB-INF/jsp/user/list.jsp
public void index() {
}
protected String checkUser (User user,boolean create){
if(user == null ){
return "空对象";
}
if(create){
if(Strings.isBlank(user.getName()) || Strings.isBlank(user.getPassword())){
return "用户/密码不能为空";
}
} else {
if(Strings.isBlank(user.getPassword())){
return "密码不能为空";
}
}
String passwd =user.getPassword().trim();
if (6 > passwd.length() || passwd.length() > 12) {
return "密码长度错误";
}
user.setPassword(passwd);
if(create){
int count =dao.count(User.class,Cnd.where("name","=",user.getName()));
if(count!=0){
return "用户已经存在";
}
}else{
if(user.getId()<1){
return "用户ID非法";
}
}
if(user.getName() != null)
user.setName(user.getName().trim());
return null;
}
}
这是UserModule.java