package net.wendal.nutzbook.module;
import java.util.Date;
import javax.servlet.http.HttpSession;
import org.nutz.aop.interceptor.ioc.TransAop;
import org.nutz.dao.Cnd;
import org.nutz.ioc.aop.Aop;
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;
import net.wendal.nutzbook.bean.User;
import net.wendal.nutzbook.bean.UserProfile;
@IocBean
@At("/user")
@Ok("json:{locked:'password|salt',ignoreNull:true}") // 忽略password和salt属性,忽略空属性的json输出
@Fail("http:500") // 抛出异常的话,就走500页面
//@Filters(@By(type=CheckSession.class, args={"me", "/"}))
public class UserModule extends BaseModule{
@At
public int count(){
return dao.count(User.class);
}
@At
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(">>:/")
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
@Aop(TransAop.READ_COMMITTED)
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);
dao.clear(UserProfile.class, Cnd.where("userId", "=", me));
return new NutMap().setv("ok", true);
}
@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;
}
@Filters
@At
@Fail("jsp:jsp.500")
public void error(){
throw new RuntimeException();
}
}
28 回复
2017-08-01 13:12:25,020 org.nutz.mvc.impl.UrlMappingImpl.get(UrlMappingImpl.java:101) DEBUG - Found mapping for [POST] path=/user/login : UserModule.login(UserModule.java:40)
2017-08-01 13:12:25,025 org.nutz.ioc.impl.NutIoc.get(NutIoc.java:151) DEBUG - Get 'userModule'<class net.wendal.nutzbook.module.UserModule>
2017-08-01 13:12:25,027 org.nutz.ioc.impl.NutIoc.get(NutIoc.java:177) DEBUG - >> Load definition name=userModule
2017-08-01 13:12:25,027 org.nutz.ioc.loader.combo.ComboIocLoader.load(ComboIocLoader.java:161) DEBUG - Found IocObject(userModule) in AnnotationIocLoader(packages=[net.wendal.nutzbook])
2017-08-01 13:12:25,028 org.nutz.ioc.impl.NutIoc.get(NutIoc.java:209) DEBUG - >> Make...'userModule'<class net.wendal.nutzbook.module.UserModule>
2017-08-01 13:12:25,030 org.nutz.ioc.impl.NutIoc.get(NutIoc.java:151) DEBUG - Get 'txREAD_COMMITTED'<interface org.nutz.aop.MethodInterceptor>
2017-08-01 13:12:25,031 org.nutz.ioc.impl.NutIoc.get(NutIoc.java:177) DEBUG - >> Load definition name=txREAD_COMMITTED
2017-08-01 13:12:25,031 org.nutz.ioc.loader.map.MapLoader.load(MapLoader.java:67) DEBUG - Loading define for name=txREAD_COMMITTED
2017-08-01 13:12:25,034 org.nutz.ioc.loader.combo.ComboIocLoader.load(ComboIocLoader.java:161) DEBUG - Found IocObject(txREAD_COMMITTED) in TransIocLoader@959782147
2017-08-01 13:12:25,034 org.nutz.ioc.impl.NutIoc.get(NutIoc.java:209) DEBUG - >> Make...'txREAD_COMMITTED'<interface org.nutz.aop.MethodInterceptor>
2017-08-01 13:12:25,034 org.nutz.ioc.impl.ScopeContext.save(ScopeContext.java:64) DEBUG - Save object 'txREAD_COMMITTED' to [app]
2017-08-01 13:12:25,059 org.nutz.aop.asm.AsmClassAgent.<clinit>(AsmClassAgent.java:29) DEBUG - AsmClassAgent will define class in Version 50
2017-08-01 13:12:25,095 org.nutz.ioc.impl.ScopeContext.save(ScopeContext.java:64) DEBUG - Save object 'userModule' to [app]
2017-08-01 13:12:25,126 org.nutz.ioc.impl.NutIoc.get(NutIoc.java:151) DEBUG - Get 'dao'<interface org.nutz.dao.Dao>
2017-08-01 13:12:25,191 org.nutz.dao.impl.sql.run.NutDaoExecutor.printSQL(NutDaoExecutor.java:388) DEBUG - SELECT * FROM User WHERE name=? AND passwd=? LIMIT 0, 1
| 1 | 2 |
|------|--------|
| test | 123456 |
For example:> "SELECT * FROM User WHERE name='test' AND passwd='123456' LIMIT 0, 1 "
2017-08-01 13:12:25,226 net.wendal.nutzbook.mvc.LogTimeProcessor.process(LogTimeProcessor.java:25) DEBUG - [POST]URI=/training/user/login 204ms
这是完全按照示例复制黏贴过来的了,还是不行
2017-08-01 15:03:02,186 org.nutz.mvc.impl.UrlMappingImpl.get(UrlMappingImpl.java:101) DEBUG - Found mapping for [POST] path=/user/login : UserModule.login(UserModule.java:38)
2017-08-01 15:03:02,187 org.nutz.ioc.impl.NutIoc.get(NutIoc.java:151) DEBUG - Get 'userModule'<class net.wendal.nutzbook.module.UserModule>
2017-08-01 15:03:02,191 org.nutz.dao.impl.sql.run.NutDaoExecutor.printSQL(NutDaoExecutor.java:388) DEBUG - 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 "
2017-08-01 15:03:02,202 net.wendal.nutzbook.mvc.LogTimeProcessor.process(LogTimeProcessor.java:27) DEBUG - [POST]URI=/nutzbook/user/login 14ms
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.QueryResult;
import org.nutz.dao.pager.Pager;
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这个属性
public class UserModule extends BaseModule {
@At
public int count() { // 统计用户数的方法,算是个测试点
return dao.count(User.class);
}
@At
@Filters // 覆盖UserModule类的@Filter设置,因为登陆可不能要求是个已经登陆的Session
public Object login(@Param("name")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(">>:/") // 跟其他方法不同,这个方法完成后就跳转首页了
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 = 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.updateIgnoreNull(user);// 真正更新的其实只有password和salt
return re.setv("ok", true);
}
@At
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);
}
@At
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; //默认分页是第1页,每页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;
}
@Filters
@At
@Fail("jsp:jsp.500")
public void error() {
throw new RuntimeException();
}
}
web.xml
<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns="http://java.sun.com/xml/ns/javaee"
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"
id="WebApp_ID" version="2.5">
<display-name>nutzbook</display-name>
<listener>
<listener-class>org.apache.shiro.web.env.EnvironmentLoaderListener</listener-class>
</listener>
<filter>
<filter-name>ShiroFilter</filter-name>
<filter-class>org.apache.shiro.web.servlet.ShiroFilter</filter-class>
</filter>
<filter-mapping>
<filter-name>ShiroFilter</filter-name>
<url-pattern>/*</url-pattern>
<dispatcher>REQUEST</dispatcher>
<dispatcher>FORWARD</dispatcher>
<dispatcher>INCLUDE</dispatcher>
<dispatcher>ERROR</dispatcher>
</filter-mapping>
<filter>
<filter-name>DruidWebStatFilter</filter-name>
<filter-class>com.alibaba.druid.support.http.WebStatFilter</filter-class>
<init-param>
<param-name>exclusions</param-name>
<param-value>*.js,*.gif,*.jpg,*.png,*.css,*.ico,/druid/*,/rs/*</param-value>
</init-param>
</filter>
<filter-mapping>
<filter-name>DruidWebStatFilter</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping>
<filter>
<filter-name>nutz</filter-name>
<filter-class>net.wendal.nutzbook.mvc.NutzBookNutFilter</filter-class>
<init-param>
<param-name>modules</param-name>
<param-value>net.wendal.nutzbook.MainModule</param-value>
</init-param>
</filter>
<filter-mapping>
<filter-name>nutz</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping>
<servlet>
<servlet-name>DruidStatView</servlet-name>
<servlet-class>com.alibaba.druid.support.http.StatViewServlet</servlet-class>
</servlet>
<servlet-mapping>
<servlet-name>DruidStatView</servlet-name>
<url-pattern>/druid/*</url-pattern>
</servlet-mapping>
<welcome-file-list>
<welcome-file>index.html</welcome-file>
<welcome-file>index.htm</welcome-file>
<welcome-file>index.jsp</welcome-file>
<welcome-file>default.html</welcome-file>
<welcome-file>default.htm</welcome-file>
<welcome-file>default.jsp</welcome-file>
</welcome-file-list>
<error-page>
<error-code>500</error-code>
<location>/WEB-INF/jsp/500.jsp</location>
</error-page>
</web-app>
MainModule
package net.wendal.nutzbook;
import org.nutz.mvc.annotation.ChainBy;
import org.nutz.mvc.annotation.Fail;
import org.nutz.mvc.annotation.IocBy;
import org.nutz.mvc.annotation.Localization;
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;
@SetupBy(value=MainSetup.class)
@IocBy(type=ComboIocProvider.class, args={"*js", "ioc/",
"*anno", "net.wendal.nutzbook",
"*tx"})
@Modules(scanPackage=true)
@ChainBy(args="mvc/nutzbook-mvc-chain.js")
@Ok("json:full")
@Fail("jsp:jsp.500")
@Localization(value="msg/", defaultLocalizationKey="zh-CN")
public class MainModule {
}
八月 01, 2017 3:11:53 下午 org.apache.tomcat.util.digester.SetPropertiesRule begin
警告: [SetPropertiesRule]{Server/Service/Engine/Host/Context} Setting property 'source' to 'org.eclipse.jst.jee.server:training' did not find a matching property.
八月 01, 2017 3:11:53 下午 org.apache.tomcat.util.digester.SetPropertiesRule begin
警告: [SetPropertiesRule]{Server/Service/Engine/Host/Context} Setting property 'source' to 'org.eclipse.jst.jee.server:nutzbook' did not find a matching property.
八月 01, 2017 3:11:53 下午 org.apache.catalina.startup.VersionLoggerListener log
信息: Server version: Apache Tomcat/8.5.16
八月 01, 2017 3:11:53 下午 org.apache.catalina.startup.VersionLoggerListener log
信息: Server built: Jun 21 2017 17:01:09 UTC
八月 01, 2017 3:11:53 下午 org.apache.catalina.startup.VersionLoggerListener log
信息: Server number: 8.5.16.0
八月 01, 2017 3:11:53 下午 org.apache.catalina.startup.VersionLoggerListener log
信息: OS Name: Windows 10
八月 01, 2017 3:11:53 下午 org.apache.catalina.startup.VersionLoggerListener log
信息: OS Version: 10.0
八月 01, 2017 3:11:53 下午 org.apache.catalina.startup.VersionLoggerListener log
信息: Architecture: amd64
八月 01, 2017 3:11:53 下午 org.apache.catalina.startup.VersionLoggerListener log
信息: Java Home: C:\Program Files\Java\jre1.8.0_131
八月 01, 2017 3:11:53 下午 org.apache.catalina.startup.VersionLoggerListener log
信息: JVM Version: 1.8.0_131-b11
八月 01, 2017 3:11:53 下午 org.apache.catalina.startup.VersionLoggerListener log
信息: JVM Vendor: Oracle Corporation
八月 01, 2017 3:11:53 下午 org.apache.catalina.startup.VersionLoggerListener log
信息: CATALINA_BASE: C:\Workspaces\eclipse\.metadata\.plugins\org.eclipse.wst.server.core\tmp0
八月 01, 2017 3:11:53 下午 org.apache.catalina.startup.VersionLoggerListener log
信息: CATALINA_HOME: C:\tomcat8.5
八月 01, 2017 3:11:53 下午 org.apache.catalina.startup.VersionLoggerListener log
信息: Command line argument: -Dcatalina.base=C:\Workspaces\eclipse\.metadata\.plugins\org.eclipse.wst.server.core\tmp0
八月 01, 2017 3:11:53 下午 org.apache.catalina.startup.VersionLoggerListener log
信息: Command line argument: -Dcatalina.home=C:\tomcat8.5
八月 01, 2017 3:11:53 下午 org.apache.catalina.startup.VersionLoggerListener log
信息: Command line argument: -Dwtp.deploy=C:\Workspaces\eclipse\.metadata\.plugins\org.eclipse.wst.server.core\tmp0\wtpwebapps
八月 01, 2017 3:11:53 下午 org.apache.catalina.startup.VersionLoggerListener log
信息: Command line argument: -Djava.endorsed.dirs=C:\tomcat8.5\endorsed
八月 01, 2017 3:11:53 下午 org.apache.catalina.startup.VersionLoggerListener log
信息: Command line argument: -Dfile.encoding=UTF-8
八月 01, 2017 3:11:53 下午 org.apache.catalina.core.AprLifecycleListener lifecycleEvent
信息: The APR based Apache Tomcat Native library which allows optimal performance in production environments was not found on the java.library.path: [C:\Program Files\Java\jre1.8.0_131\bin;C:\WINDOWS\Sun\Java\bin;C:\WINDOWS\system32;C:\WINDOWS;C:/Program Files/Java/jre1.8.0_131/bin/server;C:/Program Files/Java/jre1.8.0_131/bin;C:/Program Files/Java/jre1.8.0_131/lib/amd64;C:\ProgramData\Oracle\Java\javapath;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\WINDOWS\System32\WindowsPowerShell\v1.0\;C:\mysql5.7\bin;C:\Users\hao\AppData\Local\Microsoft\WindowsApps;;C:\Program Files\eclipse;;.]
八月 01, 2017 3:11:54 下午 org.apache.coyote.AbstractProtocol init
信息: Initializing ProtocolHandler ["http-nio-8080"]
八月 01, 2017 3:11:54 下午 org.apache.tomcat.util.net.NioSelectorPool getSharedSelector
信息: Using a shared selector for servlet write/read
八月 01, 2017 3:11:54 下午 org.apache.coyote.AbstractProtocol init
信息: Initializing ProtocolHandler ["ajp-nio-8009"]
八月 01, 2017 3:11:54 下午 org.apache.tomcat.util.net.NioSelectorPool getSharedSelector
信息: Using a shared selector for servlet write/read
八月 01, 2017 3:11:54 下午 org.apache.catalina.startup.Catalina load
信息: Initialization processed in 2147 ms
八月 01, 2017 3:11:54 下午 org.apache.catalina.core.StandardService startInternal
信息: Starting service [Catalina]
八月 01, 2017 3:11:54 下午 org.apache.catalina.core.StandardEngine startInternal
信息: Starting Servlet Engine: Apache Tomcat/8.5.16
八月 01, 2017 3:11:57 下午 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.
八月 01, 2017 3:11:57 下午 org.apache.catalina.core.ApplicationContext log
信息: Initializing Shiro environment
2017-08-01 15:11:57,748 org.apache.shiro.web.env.EnvironmentLoader.initEnvironment(EnvironmentLoader.java:128) INFO - Starting Shiro environment initialization.
2017-08-01 15:11:57,788 org.apache.shiro.web.env.IniWebEnvironment.init(IniWebEnvironment.java:76) DEBUG - Checking any specified config locations.
2017-08-01 15:11:57,788 org.apache.shiro.web.env.IniWebEnvironment.init(IniWebEnvironment.java:81) DEBUG - No INI instance or config locations specified. Trying default config locations.
2017-08-01 15:11:57,801 org.apache.shiro.io.ResourceUtils.loadFromClassPath(ResourceUtils.java:159) DEBUG - Opening resource from class path [shiro.ini]
2017-08-01 15:11:57,811 org.apache.shiro.config.Ini.load(Ini.java:351) DEBUG - Parsing [main]
2017-08-01 15:11:57,814 org.apache.shiro.config.Ini.load(Ini.java:351) DEBUG - Parsing [urls]
2017-08-01 15:11:57,820 org.apache.shiro.web.env.IniWebEnvironment.getDefaultIni(IniWebEnvironment.java:136) DEBUG - Discovered non-empty INI configuration at location 'classpath:shiro.ini'. Using for configuration.
2017-08-01 15:11:57,829 org.apache.shiro.config.IniFactorySupport.createInstance(IniFactorySupport.java:122) DEBUG - Creating instance from Ini [sections=urls]
2017-08-01 15:11:58,355 org.apache.shiro.config.IniFactorySupport.createInstance(IniFactorySupport.java:122) DEBUG - Creating instance from Ini [sections=urls]
2017-08-01 15:11:58,368 org.apache.shiro.web.filter.mgt.DefaultFilterChainManager.createChain(DefaultFilterChainManager.java:127) DEBUG - Creating chain [/*] from String definition [anon]
2017-08-01 15:11:58,369 org.apache.shiro.web.filter.mgt.DefaultFilterChainManager.applyChainConfig(DefaultFilterChainManager.java:278) DEBUG - Attempting to apply path [/*] to filter [anon] with config [null]
2017-08-01 15:11:58,371 org.apache.shiro.web.env.EnvironmentLoader.initEnvironment(EnvironmentLoader.java:136) DEBUG - Published WebEnvironment as ServletContext attribute with name [org.apache.shiro.web.env.EnvironmentLoader.ENVIRONMENT_ATTRIBUTE_KEY]
2017-08-01 15:11:58,372 org.apache.shiro.web.env.EnvironmentLoader.initEnvironment(EnvironmentLoader.java:141) INFO - Shiro environment initialized in 616 ms.
2017-08-01 15:11:58,641 org.nutz.mvc.NutFilter._init(NutFilter.java:85) INFO - NutFilter[nutz] starting ...
2017-08-01 15:11:58,672 org.nutz.resource.Scans.printLocations(Scans.java:521) DEBUG - Locations count=4 time use 9ms
2017-08-01 15:11:58,744 org.nutz.resource.Scans.printLocations(Scans.java:521) DEBUG - Locations count=20 time use 71ms
2017-08-01 15:11:59,118 org.nutz.castor.Castors.reload(Castors.java:115) DEBUG - Using 95 castor for Castors
2017-08-01 15:11:59,230 org.nutz.mvc.config.AbstractNutConfig.createLoading(AbstractNutConfig.java:59) DEBUG - Loading by class org.nutz.mvc.impl.NutLoading
2017-08-01 15:11:59,235 org.nutz.mvc.impl.NutLoading.load(NutLoading.java:55) INFO - Nutz Version : 1.r.61.r2 2017-04-18
2017-08-01 15:11:59,236 org.nutz.mvc.impl.NutLoading.load(NutLoading.java:56) INFO - Nutz.Mvc[nutz] is initializing ...
2017-08-01 15:11:59,237 org.nutz.mvc.impl.NutLoading.load(NutLoading.java:60) DEBUG - Web Container Information:
2017-08-01 15:11:59,308 org.nutz.mvc.impl.NutLoading.load(NutLoading.java:61) DEBUG - - Default Charset : UTF-8
2017-08-01 15:11:59,308 org.nutz.mvc.impl.NutLoading.load(NutLoading.java:62) DEBUG - - Current . path : C:\Program Files\eclipse\.
2017-08-01 15:11:59,308 org.nutz.mvc.impl.NutLoading.load(NutLoading.java:63) DEBUG - - Java Version : 1.8.0_131
2017-08-01 15:11:59,309 org.nutz.mvc.impl.NutLoading.load(NutLoading.java:64) DEBUG - - File separator : \
2017-08-01 15:11:59,312 org.nutz.mvc.impl.NutLoading.load(NutLoading.java:65) DEBUG - - Timezone : Asia/Shanghai
2017-08-01 15:11:59,312 org.nutz.mvc.impl.NutLoading.load(NutLoading.java:66) DEBUG - - OS : Windows 10 amd64
2017-08-01 15:11:59,313 org.nutz.mvc.impl.NutLoading.load(NutLoading.java:67) DEBUG - - ServerInfo : Apache Tomcat/8.5.16
2017-08-01 15:11:59,313 org.nutz.mvc.impl.NutLoading.load(NutLoading.java:68) DEBUG - - Servlet API : 3.1
2017-08-01 15:11:59,313 org.nutz.mvc.impl.NutLoading.load(NutLoading.java:73) DEBUG - - ContextPath : /nutzbook
2017-08-01 15:11:59,315 org.nutz.mvc.impl.NutLoading.load(NutLoading.java:74) DEBUG - - context.tempdir : C:\Workspaces\eclipse\.metadata\.plugins\org.eclipse.wst.server.core\tmp0\work\Catalina\localhost\nutzbook
2017-08-01 15:11:59,315 org.nutz.mvc.impl.NutLoading.load(NutLoading.java:75) DEBUG - - MainModule : net.wendal.nutzbook.MainModule
2017-08-01 15:11:59,318 org.nutz.mvc.impl.NutLoading.createContext(NutLoading.java:235) DEBUG - >> app.root = C:/Workspaces/eclipse/.metadata/.plugins/org.eclipse.wst.server.core/tmp0/wtpwebapps/nutzbook
2017-08-01 15:11:59,325 org.nutz.mvc.impl.NutLoading.createIoc(NutLoading.java:376) DEBUG - @IocBy(type=org.nutz.mvc.ioc.provider.ComboIocProvider, args=["*js", "ioc/", "*anno", "net.wendal.nutzbook", "*tx"],init=[])
2017-08-01 15:11:59,689 org.nutz.resource.Scans.scan(Scans.java:274) DEBUG - Found 2 resource by src( ioc/ ) , regex( ^(.+[.])(js|json)$ )
2017-08-01 15:11:59,689 org.nutz.ioc.loader.json.JsonLoader.<init>(JsonLoader.java:49) DEBUG - loading [dao.js]
2017-08-01 15:11:59,703 org.nutz.ioc.loader.json.JsonLoader.<init>(JsonLoader.java:49) DEBUG - loading [quartz.js]
2017-08-01 15:11:59,704 org.nutz.ioc.loader.json.JsonLoader.<init>(JsonLoader.java:57) DEBUG - Loaded 4 bean define from path=[ioc/] --> [scheduler, conf, dao, dataSource]
2017-08-01 15:11:59,733 org.nutz.resource.Scans.scan(Scans.java:274) DEBUG - Found 9 resource by src( net/wendal/nutzbook/ ) , regex( ^.+[.]class$ )
2017-08-01 15:11:59,959 org.nutz.ioc.loader.annotation.AnnotationIocLoader.addClass(AnnotationIocLoader.java:74) DEBUG - Found @IocBean : class net.wendal.nutzbook.module.UserModule
2017-08-01 15:11:59,985 org.nutz.ioc.loader.annotation.AnnotationIocLoader.addClass(AnnotationIocLoader.java:74) DEBUG - Found @IocBean : class net.wendal.nutzbook.quartz.NutQuartzJobFactory
2017-08-01 15:11:59,997 org.nutz.ioc.loader.annotation.AnnotationIocLoader.<init>(AnnotationIocLoader.java:50) INFO - Found 2 classes in 1 base-packages!
beans = ["nutQuartzJobFactory", "userModule"]
2017-08-01 15:12:00,088 org.nutz.ioc.loader.json.JsonLoader.<init>(JsonLoader.java:40) DEBUG - Loaded 5 bean define from reader --
[txREPEATABLE_READ, txSERIALIZABLE, txNONE, txREAD_UNCOMMITTED, txREAD_COMMITTED]
2017-08-01 15:12:00,191 org.nutz.ioc.impl.NutIoc.<init>(NutIoc.java:98) INFO - NutIoc init begin ...
2017-08-01 15:12:00,202 org.nutz.ioc.impl.NutIoc.<init>(NutIoc.java:115) INFO - ... NutIoc init complete
2017-08-01 15:12:00,227 org.nutz.mvc.impl.NutLoading.evalUrlMapping(NutLoading.java:159) INFO - Build URL mapping by org.nutz.mvc.impl.UrlMappingImpl ...
2017-08-01 15:12:00,298 org.nutz.mvc.impl.NutLoading.createViewMakers(NutLoading.java:366) DEBUG - @Views(DefaultViewMaker.class)
2017-08-01 15:12:00,487 org.nutz.resource.Scans.scan(Scans.java:274) DEBUG - Found 1 resource by src( mvc/nutzbook-mvc-chain.js ) , regex( ^(.+[.])(js|json)$ )
2017-08-01 15:12:00,525 org.nutz.mvc.impl.chainconfig.JsonActionChainMakerConfiguretion.<init>(JsonActionChainMakerConfiguretion.java:37) DEBUG - ActionChain Config:
{
"default": {
"ps": ["net.wendal.nutzbook.mvc.LogTimeProcessor", "org.nutz.mvc.impl.processor.UpdateRequestAttributesProcessor", "org.nutz.mvc.impl.processor.EncodingProcessor", "org.nutz.mvc.impl.processor.ModuleProcessor", "org.nutz.mvc.impl.processor.ActionFiltersProcessor", "org.nutz.mvc.impl.processor.AdaptorProcessor", "org.nutz.mvc.impl.processor.MethodInvokeProcessor", "org.nutz.mvc.impl.processor.ViewProcessor"],
"error": "org.nutz.mvc.impl.processor.FailProcessor"
}
}
2017-08-01 15:12:00,527 org.nutz.mvc.impl.NutLoading.createChainMaker(NutLoading.java:263) DEBUG - @ChainBy(org.nutz.mvc.impl.NutActionChainMaker)
2017-08-01 15:12:00,624 org.nutz.mvc.impl.Loadings.scanModules(Loadings.java:154) DEBUG - module class location 'file:/C:/Workspaces/eclipse/.metadata/.plugins/org.eclipse.wst.server.core/tmp0/wtpwebapps/nutzbook/WEB-INF/classes/'
2017-08-01 15:12:00,625 org.nutz.mvc.impl.Loadings.scanModuleInPackage(Loadings.java:184) DEBUG - > scan 'net.wendal.nutzbook'
2017-08-01 15:12:00,717 org.nutz.resource.Scans.scan(Scans.java:274) DEBUG - Found 9 resource by src( net/wendal/nutzbook/ ) , regex( ^.+[.]class$ )
2017-08-01 15:12:00,723 org.nutz.mvc.impl.Loadings.checkModule(Loadings.java:199) DEBUG - >> add 'net.wendal.nutzbook.module.UserModule'
2017-08-01 15:12:01,148 org.nutz.mvc.impl.UrlMappingImpl.print(UrlMappingImpl.java:146) DEBUG - '/user/' >> (UserModule.java:100).index : void | @Ok(jsp:jsp.user.list) @Fail(http:500) | by 1 Filters | (I:UTF-8/O:UTF-8)
2017-08-01 15:12:01,520 org.nutz.mvc.impl.UrlMappingImpl.print(UrlMappingImpl.java:146) DEBUG - '/user/add' >> (UserModule.java:55).add : Object | @Ok(json:{locked:'password|salt',ignoreNull:true}) @Fail(http:500) | by 1 Filters | (I:UTF-8/O:UTF-8)
2017-08-01 15:12:01,525 org.nutz.mvc.impl.UrlMappingImpl.print(UrlMappingImpl.java:146) DEBUG - '/user/count' >> (UserModule.java:32).count : int | @Ok(json:{locked:'password|salt',ignoreNull:true}) @Fail(http:500) | by 1 Filters | (I:UTF-8/O:UTF-8)
2017-08-01 15:12:01,532 org.nutz.mvc.impl.UrlMappingImpl.print(UrlMappingImpl.java:146) DEBUG - '/user/update' >> (UserModule.java:66).update : Object | @Ok(json:{locked:'password|salt',ignoreNull:true}) @Fail(http:500) | by 1 Filters | (I:UTF-8/O:UTF-8)
2017-08-01 15:12:01,553 org.nutz.mvc.impl.UrlMappingImpl.print(UrlMappingImpl.java:146) DEBUG - '/user/delete' >> (UserModule.java:80).delete : Object | @Ok(json:{locked:'password|salt',ignoreNull:true}) @Fail(http:500) | by 1 Filters | (I:UTF-8/O:UTF-8)
2017-08-01 15:12:01,764 org.nutz.mvc.impl.UrlMappingImpl.print(UrlMappingImpl.java:146) DEBUG - '/user/query' >> (UserModule.java:89).query : Object | @Ok(json:{locked:'password|salt',ignoreNull:true}) @Fail(http:500) | by 1 Filters | (I:UTF-8/O:UTF-8)
2017-08-01 15:12:01,767 org.nutz.mvc.impl.UrlMappingImpl.print(UrlMappingImpl.java:146) DEBUG - '/user/error' >> (UserModule.java:137).error : void | @Ok(json:{locked:'password|salt',ignoreNull:true}) @Fail(jsp:jsp.500) | by 0 Filters | (I:UTF-8/O:UTF-8)
2017-08-01 15:12:01,771 org.nutz.mvc.impl.UrlMappingImpl.print(UrlMappingImpl.java:146) DEBUG - '/user/login' >> (UserModule.java:38).login : Object | @Ok(json:{locked:'password|salt',ignoreNull:true}) @Fail(http:500) | by 0 Filters | (I:UTF-8/O:UTF-8)
2017-08-01 15:12:01,778 org.nutz.mvc.impl.UrlMappingImpl.print(UrlMappingImpl.java:146) DEBUG - '/user/logout' >> (UserModule.java:50).logout : void | @Ok(>>:/ ) @Fail(http:500) | by 1 Filters | (I:UTF-8/O:UTF-8)
2017-08-01 15:12:01,779 org.nutz.mvc.impl.NutLoading.evalUrlMapping(NutLoading.java:217) INFO - Found 9 module methods
2017-08-01 15:12:01,783 org.nutz.mvc.impl.NutLoading.evalLocalization(NutLoading.java:303) DEBUG - Localization: org.nutz.mvc.impl.NutMessageLoader('msg/') dft<zh-CN>
2017-08-01 15:12:01,793 org.nutz.resource.Scans.scan(Scans.java:274) DEBUG - Found 1 resource by src( msg/ ) , regex( ^.+[.]properties$ )
2017-08-01 15:12:01,793 org.nutz.mvc.impl.NutMessageLoader.load(NutMessageLoader.java:27) DEBUG - Load Messages in 1 resource : [[File[C:\Workspaces\eclipse\.metadata\.plugins\org.eclipse.wst.server.core\tmp0\wtpwebapps\nutzbook\WEB-INF\classes\msg\zh-CN\user.properties]]]
2017-08-01 15:12:01,799 org.nutz.mvc.impl.NutMessageLoader.load(NutMessageLoader.java:95) DEBUG - Message Loaded, size = 2
2017-08-01 15:12:01,801 org.nutz.mvc.impl.NutLoading.evalSetup(NutLoading.java:271) INFO - Setup application...
2017-08-01 15:12:01,809 org.nutz.ioc.impl.NutIoc.get(NutIoc.java:151) DEBUG - Get 'dao'<interface org.nutz.dao.Dao>
2017-08-01 15:12:01,819 org.nutz.ioc.aop.SimpleAopMaker.<init>(SimpleAopMaker.java:79) DEBUG - Load AopConfigure for anno=org.nutz.ioc.aop.Aop by type=org.nutz.ioc.aop.config.impl.AnnotationAopConfigration
2017-08-01 15:12:01,827 org.nutz.ioc.impl.NutIoc.get(NutIoc.java:177) DEBUG - >> Load definition name=dao
2017-08-01 15:12:01,828 org.nutz.ioc.loader.map.MapLoader.load(MapLoader.java:67) DEBUG - Loading define for name=dao
2017-08-01 15:12:01,838 org.nutz.ioc.loader.combo.ComboIocLoader.load(ComboIocLoader.java:161) DEBUG - Found IocObject(dao) in JsonLoader(paths=[ioc/])
2017-08-01 15:12:01,842 org.nutz.ioc.impl.NutIoc.get(NutIoc.java:209) DEBUG - >> Make...'dao'<interface org.nutz.dao.Dao>
2017-08-01 15:12:02,139 org.nutz.ioc.aop.impl.DefaultMirrorFactory.getMirror(DefaultMirrorFactory.java:70) DEBUG - Load class org.nutz.dao.impl.NutDao without AOP
2017-08-01 15:12:02,145 org.nutz.ioc.impl.ScopeContext.save(ScopeContext.java:64) DEBUG - Save object 'dao' to [app]
2017-08-01 15:12:02,152 org.nutz.ioc.impl.NutIoc.get(NutIoc.java:151) DEBUG - Get 'dataSource'<>
2017-08-01 15:12:02,152 org.nutz.ioc.impl.NutIoc.get(NutIoc.java:177) DEBUG - >> Load definition name=dataSource
2017-08-01 15:12:02,153 org.nutz.ioc.loader.map.MapLoader.load(MapLoader.java:67) DEBUG - Loading define for name=dataSource
2017-08-01 15:12:02,184 org.nutz.ioc.loader.combo.ComboIocLoader.load(ComboIocLoader.java:161) DEBUG - Found IocObject(dataSource) in JsonLoader(paths=[ioc/])
2017-08-01 15:12:02,185 org.nutz.ioc.impl.NutIoc.get(NutIoc.java:209) DEBUG - >> Make...'dataSource'<>
2017-08-01 15:12:02,238 org.nutz.ioc.aop.impl.DefaultMirrorFactory.getMirror(DefaultMirrorFactory.java:70) DEBUG - Load class com.alibaba.druid.pool.DruidDataSource without AOP
2017-08-01 15:12:02,239 org.nutz.ioc.impl.ScopeContext.save(ScopeContext.java:64) DEBUG - Save object 'dataSource' to [app]
2017-08-01 15:12:03,028 org.nutz.ioc.impl.NutIoc.get(NutIoc.java:151) DEBUG - Get 'conf'<>
2017-08-01 15:12:03,029 org.nutz.ioc.impl.NutIoc.get(NutIoc.java:177) DEBUG - >> Load definition name=conf
2017-08-01 15:12:03,029 org.nutz.ioc.loader.map.MapLoader.load(MapLoader.java:67) DEBUG - Loading define for name=conf
2017-08-01 15:12:03,045 org.nutz.ioc.loader.combo.ComboIocLoader.load(ComboIocLoader.java:161) DEBUG - Found IocObject(conf) in JsonLoader(paths=[ioc/])
2017-08-01 15:12:03,045 org.nutz.ioc.impl.NutIoc.get(NutIoc.java:209) DEBUG - >> Make...'conf'<>
2017-08-01 15:12:03,047 org.nutz.ioc.aop.impl.DefaultMirrorFactory.getMirror(DefaultMirrorFactory.java:70) DEBUG - Load class org.nutz.ioc.impl.PropertiesProxy without AOP
2017-08-01 15:12:03,048 org.nutz.ioc.impl.ScopeContext.save(ScopeContext.java:64) DEBUG - Save object 'conf' to [app]
2017-08-01 15:12:03,377 org.nutz.resource.Scans.scan(Scans.java:274) DEBUG - Found 1 resource by src( custom/db.properties ) , regex( ^.+[.]properties$ )
2017-08-01 15:12:03,378 org.nutz.ioc.impl.PropertiesProxy.setPaths(PropertiesProxy.java:113) DEBUG - load properties from File[C:\Workspaces\eclipse\.metadata\.plugins\org.eclipse.wst.server.core\tmp0\wtpwebapps\nutzbook\WEB-INF\classes\custom\db.properties]
2017-08-01 15:12:03,454 org.nutz.ioc.impl.NutIoc.get(NutIoc.java:151) DEBUG - Get 'conf'<>
2017-08-01 15:12:03,455 org.nutz.ioc.impl.NutIoc.get(NutIoc.java:151) DEBUG - Get 'conf'<>
2017-08-01 15:12:03,457 org.nutz.ioc.impl.NutIoc.get(NutIoc.java:151) DEBUG - Get 'conf'<>
2017-08-01 15:12:03,458 org.nutz.ioc.impl.NutIoc.get(NutIoc.java:151) DEBUG - Get 'conf'<>
2017-08-01 15:12:03,655 com.alibaba.druid.pool.DruidDataSource.init(DruidDataSource.java:715) INFO - {dataSource-1} inited
2017-08-01 15:12:03,657 org.nutz.ioc.impl.NutIoc.get(NutIoc.java:151) DEBUG - Get 'dataSource'<>
2017-08-01 15:12:04,079 org.nutz.filepool.NutFilePool.<init>(NutFilePool.java:23) INFO - Init file-pool by: C:\Users\hao/.nutz/tmp/dao/ [200000]
2017-08-01 15:12:04,080 org.nutz.filepool.NutFilePool.<init>(NutFilePool.java:37) DEBUG - file-pool.home: 'C:\Users\hao\.nutz\tmp\dao'
2017-08-01 15:12:04,083 org.nutz.filepool.NutFilePool.<init>(NutFilePool.java:66) INFO - file-pool.cursor: 0
2017-08-01 15:12:04,411 org.nutz.dao.jdbc.Jdbcs.<clinit>(Jdbcs.java:90) DEBUG - Jdbcs init complete
2017-08-01 15:12:04,413 org.nutz.dao.jdbc.Jdbcs.getExpert(Jdbcs.java:103) INFO - Get Connection from DataSource for JdbcExpert, if you lock at here, check your database server and configure
Tue Aug 01 15:12:04 CST 2017 WARN: Establishing SSL connection without server's identity verification is not recommended. According to MySQL 5.5.45+, 5.6.26+ and 5.7.6+ requirements SSL connection must be established by default if explicit option isn't set. For compliance with existing applications not using SSL the verifyServerCertificate property is set to 'false'. You need either to explicitly disable SSL by setting useSSL=false, or set useSSL=true and provide truststore for server certificate verification.
2017-08-01 15:12:05,519 org.nutz.dao.impl.DaoSupport.setDataSource(DaoSupport.java:189) DEBUG - select expert : org.nutz.dao.impl.jdbc.mysql.MysqlJdbcExpert
2017-08-01 15:12:05,533 org.nutz.dao.impl.DaoSupport$1.invoke(DaoSupport.java:200) DEBUG - JDBC Driver --> mysql-connector-java-5.1.40 ( Revision: 402933ef52cad9aa82624e80acbea46e3a701ce6 )
2017-08-01 15:12:05,535 org.nutz.dao.impl.DaoSupport$1.invoke(DaoSupport.java:201) DEBUG - JDBC Name --> MySQL Connector Java
2017-08-01 15:12:05,537 org.nutz.dao.impl.DaoSupport$1.invoke(DaoSupport.java:203) DEBUG - JDBC URL --> jdbc:mysql://127.0.0.1:3306/nutz
2017-08-01 15:12:05,566 org.nutz.dao.impl.jdbc.mysql.MysqlJdbcExpert.checkDataSource(MysqlJdbcExpert.java:212) DEBUG - Mysql : character_set_client=utf8
2017-08-01 15:12:05,567 org.nutz.dao.impl.jdbc.mysql.MysqlJdbcExpert.checkDataSource(MysqlJdbcExpert.java:212) DEBUG - Mysql : character_set_connection=utf8
2017-08-01 15:12:05,568 org.nutz.dao.impl.jdbc.mysql.MysqlJdbcExpert.checkDataSource(MysqlJdbcExpert.java:212) DEBUG - Mysql : character_set_database=utf8
2017-08-01 15:12:05,568 org.nutz.dao.impl.jdbc.mysql.MysqlJdbcExpert.checkDataSource(MysqlJdbcExpert.java:212) DEBUG - Mysql : character_set_filesystem=binary
2017-08-01 15:12:05,568 org.nutz.dao.impl.jdbc.mysql.MysqlJdbcExpert.checkDataSource(MysqlJdbcExpert.java:212) DEBUG - Mysql : character_set_results=
2017-08-01 15:12:05,568 org.nutz.dao.impl.jdbc.mysql.MysqlJdbcExpert.checkDataSource(MysqlJdbcExpert.java:212) DEBUG - Mysql : character_set_server=utf8
2017-08-01 15:12:05,568 org.nutz.dao.impl.jdbc.mysql.MysqlJdbcExpert.checkDataSource(MysqlJdbcExpert.java:212) DEBUG - Mysql : character_set_system=utf8
2017-08-01 15:12:05,569 org.nutz.dao.impl.jdbc.mysql.MysqlJdbcExpert.checkDataSource(MysqlJdbcExpert.java:212) DEBUG - Mysql : character_sets_dir=C:\mysql5.7\share\charsets\
2017-08-01 15:12:05,577 org.nutz.dao.impl.jdbc.mysql.MysqlJdbcExpert.checkDataSource(MysqlJdbcExpert.java:219) DEBUG - Mysql : binlog_format=ROW
2017-08-01 15:12:05,579 org.nutz.dao.impl.jdbc.mysql.MysqlJdbcExpert.checkDataSource(MysqlJdbcExpert.java:226) DEBUG - Mysql : database=nutz
2017-08-01 15:12:05,582 org.nutz.dao.impl.jdbc.mysql.MysqlJdbcExpert.checkDataSource(MysqlJdbcExpert.java:232) DEBUG - Mysql : user=root@localhost
2017-08-01 15:12:05,657 org.nutz.dao.impl.DaoSupport.setDataSource(DaoSupport.java:222) DEBUG - Database info --> MYSQL:[MySQL - 5.7.18]
2017-08-01 15:12:05,693 org.nutz.resource.Scans.scan(Scans.java:274) DEBUG - Found 9 resource by src( net/wendal/nutzbook/ ) , regex( ^.+[.]class$ )
2017-08-01 15:12:05,875 org.nutz.dao.impl.sql.run.NutDaoExecutor.printSQL(NutDaoExecutor.java:388) DEBUG - SELECT COUNT(*) FROM t_user
2017-08-01 15:12:05,895 org.nutz.ioc.impl.NutIoc.get(NutIoc.java:151) DEBUG - Get 'scheduler'<interface org.quartz.Scheduler>
2017-08-01 15:12:05,898 org.nutz.ioc.impl.NutIoc.get(NutIoc.java:177) DEBUG - >> Load definition name=scheduler
2017-08-01 15:12:05,898 org.nutz.ioc.loader.map.MapLoader.load(MapLoader.java:67) DEBUG - Loading define for name=scheduler
2017-08-01 15:12:05,899 org.nutz.ioc.loader.combo.ComboIocLoader.load(ComboIocLoader.java:161) DEBUG - Found IocObject(scheduler) in JsonLoader(paths=[ioc/])
2017-08-01 15:12:05,899 org.nutz.ioc.impl.NutIoc.get(NutIoc.java:209) DEBUG - >> Make...'scheduler'<interface org.quartz.Scheduler>
2017-08-01 15:12:05,899 org.nutz.ioc.impl.ScopeContext.save(ScopeContext.java:64) DEBUG - Save object 'scheduler' to [app]
2017-08-01 15:12:06,050 org.quartz.impl.StdSchedulerFactory.instantiate(StdSchedulerFactory.java:1172) INFO - Using default implementation for ThreadExecutor
2017-08-01 15:12:06,122 org.quartz.core.SchedulerSignalerImpl.<init>(SchedulerSignalerImpl.java:61) INFO - Initialized Scheduler Signaller of type: class org.quartz.core.SchedulerSignalerImpl
2017-08-01 15:12:06,122 org.quartz.core.QuartzScheduler.<init>(QuartzScheduler.java:240) INFO - Quartz Scheduler v.2.2.3 created.
2017-08-01 15:12:06,125 org.quartz.simpl.RAMJobStore.initialize(RAMJobStore.java:155) INFO - RAMJobStore initialized.
2017-08-01 15:12:06,126 org.quartz.core.QuartzScheduler.initialize(QuartzScheduler.java:305) INFO - Scheduler meta-data: Quartz Scheduler (v2.2.3) 'NutzbookScheduler' with instanceId 'NON_CLUSTERED'
Scheduler class: 'org.quartz.core.QuartzScheduler' - running locally.
NOT STARTED.
Currently in standby mode.
Number of jobs executed: 0
Using thread pool 'org.quartz.simpl.SimpleThreadPool' - with 3 threads.
Using job-store 'org.quartz.simpl.RAMJobStore' - which does not support persistence. and is not clustered.
2017-08-01 15:12:06,126 org.quartz.impl.StdSchedulerFactory.instantiate(StdSchedulerFactory.java:1327) INFO - Quartz scheduler 'NutzbookScheduler' initialized from default resource file in Quartz package: 'quartz.properties'
2017-08-01 15:12:06,126 org.quartz.impl.StdSchedulerFactory.instantiate(StdSchedulerFactory.java:1331) INFO - Quartz scheduler version: 2.2.3
2017-08-01 15:12:06,126 org.nutz.ioc.impl.NutIoc.get(NutIoc.java:151) DEBUG - Get 'nutQuartzJobFactory'<>
2017-08-01 15:12:06,126 org.nutz.ioc.impl.NutIoc.get(NutIoc.java:177) DEBUG - >> Load definition name=nutQuartzJobFactory
2017-08-01 15:12:06,126 org.nutz.ioc.loader.combo.ComboIocLoader.load(ComboIocLoader.java:161) DEBUG - Found IocObject(nutQuartzJobFactory) in AnnotationIocLoader(packages=[net.wendal.nutzbook])
2017-08-01 15:12:06,126 org.nutz.ioc.impl.NutIoc.get(NutIoc.java:209) DEBUG - >> Make...'nutQuartzJobFactory'<>
2017-08-01 15:12:06,126 org.nutz.ioc.aop.impl.DefaultMirrorFactory.getMirror(DefaultMirrorFactory.java:70) DEBUG - Load class net.wendal.nutzbook.quartz.NutQuartzJobFactory without AOP
2017-08-01 15:12:06,126 org.nutz.ioc.impl.ScopeContext.save(ScopeContext.java:64) DEBUG - Save object 'nutQuartzJobFactory' to [app]
2017-08-01 15:12:06,319 org.quartz.core.QuartzScheduler.setJobFactory(QuartzScheduler.java:2311) INFO - JobFactory set to: net.wendal.nutzbook.quartz.NutQuartzJobFactory@5a75580a
2017-08-01 15:12:06,320 org.quartz.core.QuartzSchedulerThread.run(QuartzSchedulerThread.java:276) DEBUG - batch acquisition of 0 triggers
2017-08-01 15:12:06,320 org.quartz.core.QuartzScheduler.start(QuartzScheduler.java:575) INFO - Scheduler NutzbookScheduler_$_NON_CLUSTERED started.
2017-08-01 15:12:06,321 org.nutz.mvc.impl.NutLoading.load(NutLoading.java:141) INFO - Nutz.Mvc[nutz] is up in 7005ms
八月 01, 2017 3:12:06 下午 org.apache.coyote.AbstractProtocol start
信息: Starting ProtocolHandler ["http-nio-8080"]
八月 01, 2017 3:12:06 下午 org.apache.coyote.AbstractProtocol start
信息: Starting ProtocolHandler ["ajp-nio-8009"]
八月 01, 2017 3:12:06 下午 org.apache.catalina.startup.Catalina start
信息: Server startup in 12028 ms
2017-08-01 15:12:17,431 org.nutz.mvc.impl.UrlMappingImpl.get(UrlMappingImpl.java:101) DEBUG - Found mapping for [POST] path=/user/login : UserModule.login(UserModule.java:38)
2017-08-01 15:12:17,434 org.nutz.ioc.impl.NutIoc.get(NutIoc.java:151) DEBUG - Get 'userModule'<class net.wendal.nutzbook.module.UserModule>
2017-08-01 15:12:17,435 org.nutz.ioc.impl.NutIoc.get(NutIoc.java:177) DEBUG - >> Load definition name=userModule
2017-08-01 15:12:17,435 org.nutz.ioc.loader.combo.ComboIocLoader.load(ComboIocLoader.java:161) DEBUG - Found IocObject(userModule) in AnnotationIocLoader(packages=[net.wendal.nutzbook])
2017-08-01 15:12:17,436 org.nutz.ioc.impl.NutIoc.get(NutIoc.java:209) DEBUG - >> Make...'userModule'<class net.wendal.nutzbook.module.UserModule>
2017-08-01 15:12:17,438 org.nutz.ioc.aop.impl.DefaultMirrorFactory.getMirror(DefaultMirrorFactory.java:70) DEBUG - Load class net.wendal.nutzbook.module.UserModule without AOP
2017-08-01 15:12:17,439 org.nutz.ioc.impl.ScopeContext.save(ScopeContext.java:64) DEBUG - Save object 'userModule' to [app]
2017-08-01 15:12:17,523 org.nutz.ioc.impl.NutIoc.get(NutIoc.java:151) DEBUG - Get 'dao'<interface org.nutz.dao.Dao>
2017-08-01 15:12:17,596 org.nutz.dao.impl.sql.run.NutDaoExecutor.printSQL(NutDaoExecutor.java:388) DEBUG - 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 "
2017-08-01 15:12:17,666 net.wendal.nutzbook.mvc.LogTimeProcessor.process(LogTimeProcessor.java:27) DEBUG - [POST]URI=/nutzbook/user/login 234ms
直接URL访问一些 http://127.0.0.1:8080/nutzbook/user/count 看看出啥
页面显示1
八月 01, 2017 3:19:04 下午 org.apache.tomcat.util.digester.SetPropertiesRule begin
警告: [SetPropertiesRule]{Server/Service/Engine/Host/Context} Setting property 'source' to 'org.eclipse.jst.jee.server:training' did not find a matching property.
八月 01, 2017 3:19:04 下午 org.apache.tomcat.util.digester.SetPropertiesRule begin
警告: [SetPropertiesRule]{Server/Service/Engine/Host/Context} Setting property 'source' to 'org.eclipse.jst.jee.server:nutzbook' did not find a matching property.
八月 01, 2017 3:19:04 下午 org.apache.catalina.startup.VersionLoggerListener log
信息: Server version: Apache Tomcat/8.5.16
八月 01, 2017 3:19:04 下午 org.apache.catalina.startup.VersionLoggerListener log
信息: Server built: Jun 21 2017 17:01:09 UTC
八月 01, 2017 3:19:04 下午 org.apache.catalina.startup.VersionLoggerListener log
信息: Server number: 8.5.16.0
八月 01, 2017 3:19:04 下午 org.apache.catalina.startup.VersionLoggerListener log
信息: OS Name: Windows 10
八月 01, 2017 3:19:04 下午 org.apache.catalina.startup.VersionLoggerListener log
信息: OS Version: 10.0
八月 01, 2017 3:19:04 下午 org.apache.catalina.startup.VersionLoggerListener log
信息: Architecture: amd64
八月 01, 2017 3:19:04 下午 org.apache.catalina.startup.VersionLoggerListener log
信息: Java Home: C:\Program Files\Java\jre1.8.0_131
八月 01, 2017 3:19:04 下午 org.apache.catalina.startup.VersionLoggerListener log
信息: JVM Version: 1.8.0_131-b11
八月 01, 2017 3:19:04 下午 org.apache.catalina.startup.VersionLoggerListener log
信息: JVM Vendor: Oracle Corporation
八月 01, 2017 3:19:04 下午 org.apache.catalina.startup.VersionLoggerListener log
信息: CATALINA_BASE: C:\Workspaces\eclipse\.metadata\.plugins\org.eclipse.wst.server.core\tmp0
八月 01, 2017 3:19:04 下午 org.apache.catalina.startup.VersionLoggerListener log
信息: CATALINA_HOME: C:\tomcat8.5
八月 01, 2017 3:19:04 下午 org.apache.catalina.startup.VersionLoggerListener log
信息: Command line argument: -Dcatalina.base=C:\Workspaces\eclipse\.metadata\.plugins\org.eclipse.wst.server.core\tmp0
八月 01, 2017 3:19:04 下午 org.apache.catalina.startup.VersionLoggerListener log
信息: Command line argument: -Dcatalina.home=C:\tomcat8.5
八月 01, 2017 3:19:04 下午 org.apache.catalina.startup.VersionLoggerListener log
信息: Command line argument: -Dwtp.deploy=C:\Workspaces\eclipse\.metadata\.plugins\org.eclipse.wst.server.core\tmp0\wtpwebapps
八月 01, 2017 3:19:04 下午 org.apache.catalina.startup.VersionLoggerListener log
信息: Command line argument: -Djava.endorsed.dirs=C:\tomcat8.5\endorsed
八月 01, 2017 3:19:04 下午 org.apache.catalina.startup.VersionLoggerListener log
信息: Command line argument: -Dfile.encoding=UTF-8
八月 01, 2017 3:19:04 下午 org.apache.catalina.core.AprLifecycleListener lifecycleEvent
信息: The APR based Apache Tomcat Native library which allows optimal performance in production environments was not found on the java.library.path: [C:\Program Files\Java\jre1.8.0_131\bin;C:\WINDOWS\Sun\Java\bin;C:\WINDOWS\system32;C:\WINDOWS;C:/Program Files/Java/jre1.8.0_131/bin/server;C:/Program Files/Java/jre1.8.0_131/bin;C:/Program Files/Java/jre1.8.0_131/lib/amd64;C:\ProgramData\Oracle\Java\javapath;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\WINDOWS\System32\WindowsPowerShell\v1.0\;C:\mysql5.7\bin;C:\Users\hao\AppData\Local\Microsoft\WindowsApps;;C:\Program Files\eclipse;;.]
八月 01, 2017 3:19:05 下午 org.apache.coyote.AbstractProtocol init
信息: Initializing ProtocolHandler ["http-nio-8080"]
八月 01, 2017 3:19:05 下午 org.apache.tomcat.util.net.NioSelectorPool getSharedSelector
信息: Using a shared selector for servlet write/read
八月 01, 2017 3:19:05 下午 org.apache.coyote.AbstractProtocol init
信息: Initializing ProtocolHandler ["ajp-nio-8009"]
八月 01, 2017 3:19:05 下午 org.apache.tomcat.util.net.NioSelectorPool getSharedSelector
信息: Using a shared selector for servlet write/read
八月 01, 2017 3:19:05 下午 org.apache.catalina.startup.Catalina load
信息: Initialization processed in 2103 ms
八月 01, 2017 3:19:05 下午 org.apache.catalina.core.StandardService startInternal
信息: Starting service [Catalina]
八月 01, 2017 3:19:05 下午 org.apache.catalina.core.StandardEngine startInternal
信息: Starting Servlet Engine: Apache Tomcat/8.5.16
八月 01, 2017 3:19:08 下午 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.
八月 01, 2017 3:19:09 下午 org.apache.catalina.core.ApplicationContext log
信息: Initializing Shiro environment
2017-08-01 15:19:09,226 org.apache.shiro.web.env.EnvironmentLoader.initEnvironment(EnvironmentLoader.java:128) INFO - Starting Shiro environment initialization.
2017-08-01 15:19:09,255 org.apache.shiro.web.env.IniWebEnvironment.init(IniWebEnvironment.java:76) DEBUG - Checking any specified config locations.
2017-08-01 15:19:09,256 org.apache.shiro.web.env.IniWebEnvironment.init(IniWebEnvironment.java:81) DEBUG - No INI instance or config locations specified. Trying default config locations.
2017-08-01 15:19:09,269 org.apache.shiro.io.ResourceUtils.loadFromClassPath(ResourceUtils.java:159) DEBUG - Opening resource from class path [shiro.ini]
2017-08-01 15:19:09,280 org.apache.shiro.config.Ini.load(Ini.java:351) DEBUG - Parsing [main]
2017-08-01 15:19:09,287 org.apache.shiro.config.Ini.load(Ini.java:351) DEBUG - Parsing [urls]
2017-08-01 15:19:09,292 org.apache.shiro.web.env.IniWebEnvironment.getDefaultIni(IniWebEnvironment.java:136) DEBUG - Discovered non-empty INI configuration at location 'classpath:shiro.ini'. Using for configuration.
2017-08-01 15:19:09,305 org.apache.shiro.config.IniFactorySupport.createInstance(IniFactorySupport.java:122) DEBUG - Creating instance from Ini [sections=urls]
2017-08-01 15:19:09,960 org.apache.shiro.config.IniFactorySupport.createInstance(IniFactorySupport.java:122) DEBUG - Creating instance from Ini [sections=urls]
2017-08-01 15:19:09,976 org.apache.shiro.web.filter.mgt.DefaultFilterChainManager.createChain(DefaultFilterChainManager.java:127) DEBUG - Creating chain [/*] from String definition [anon]
2017-08-01 15:19:09,976 org.apache.shiro.web.filter.mgt.DefaultFilterChainManager.applyChainConfig(DefaultFilterChainManager.java:278) DEBUG - Attempting to apply path [/*] to filter [anon] with config [null]
2017-08-01 15:19:09,977 org.apache.shiro.web.env.EnvironmentLoader.initEnvironment(EnvironmentLoader.java:136) DEBUG - Published WebEnvironment as ServletContext attribute with name [org.apache.shiro.web.env.EnvironmentLoader.ENVIRONMENT_ATTRIBUTE_KEY]
2017-08-01 15:19:09,979 org.apache.shiro.web.env.EnvironmentLoader.initEnvironment(EnvironmentLoader.java:141) INFO - Shiro environment initialized in 747 ms.
2017-08-01 15:19:10,063 org.nutz.mvc.NutFilter._init(NutFilter.java:85) INFO - NutFilter[nutz] starting ...
2017-08-01 15:19:10,104 org.nutz.resource.Scans.printLocations(Scans.java:521) DEBUG - Locations count=4 time use 8ms
2017-08-01 15:19:10,147 org.nutz.resource.Scans.printLocations(Scans.java:521) DEBUG - Locations count=20 time use 41ms
2017-08-01 15:19:10,481 org.nutz.castor.Castors.reload(Castors.java:115) DEBUG - Using 95 castor for Castors
2017-08-01 15:19:10,588 org.nutz.mvc.config.AbstractNutConfig.createLoading(AbstractNutConfig.java:59) DEBUG - Loading by class org.nutz.mvc.impl.NutLoading
2017-08-01 15:19:10,599 org.nutz.mvc.impl.NutLoading.load(NutLoading.java:55) INFO - Nutz Version : 1.r.61.r2 2017-04-18
2017-08-01 15:19:10,599 org.nutz.mvc.impl.NutLoading.load(NutLoading.java:56) INFO - Nutz.Mvc[nutz] is initializing ...
2017-08-01 15:19:10,599 org.nutz.mvc.impl.NutLoading.load(NutLoading.java:60) DEBUG - Web Container Information:
2017-08-01 15:19:10,630 org.nutz.mvc.impl.NutLoading.load(NutLoading.java:61) DEBUG - - Default Charset : UTF-8
2017-08-01 15:19:10,631 org.nutz.mvc.impl.NutLoading.load(NutLoading.java:62) DEBUG - - Current . path : C:\Program Files\eclipse\.
2017-08-01 15:19:10,631 org.nutz.mvc.impl.NutLoading.load(NutLoading.java:63) DEBUG - - Java Version : 1.8.0_131
2017-08-01 15:19:10,632 org.nutz.mvc.impl.NutLoading.load(NutLoading.java:64) DEBUG - - File separator : \
2017-08-01 15:19:10,632 org.nutz.mvc.impl.NutLoading.load(NutLoading.java:65) DEBUG - - Timezone : Asia/Shanghai
2017-08-01 15:19:10,634 org.nutz.mvc.impl.NutLoading.load(NutLoading.java:66) DEBUG - - OS : Windows 10 amd64
2017-08-01 15:19:10,635 org.nutz.mvc.impl.NutLoading.load(NutLoading.java:67) DEBUG - - ServerInfo : Apache Tomcat/8.5.16
2017-08-01 15:19:10,642 org.nutz.mvc.impl.NutLoading.load(NutLoading.java:68) DEBUG - - Servlet API : 3.1
2017-08-01 15:19:10,643 org.nutz.mvc.impl.NutLoading.load(NutLoading.java:73) DEBUG - - ContextPath : /nutzbook
2017-08-01 15:19:10,648 org.nutz.mvc.impl.NutLoading.load(NutLoading.java:74) DEBUG - - context.tempdir : C:\Workspaces\eclipse\.metadata\.plugins\org.eclipse.wst.server.core\tmp0\work\Catalina\localhost\nutzbook
2017-08-01 15:19:10,648 org.nutz.mvc.impl.NutLoading.load(NutLoading.java:75) DEBUG - - MainModule : net.wendal.nutzbook.MainModule
2017-08-01 15:19:10,650 org.nutz.mvc.impl.NutLoading.createContext(NutLoading.java:235) DEBUG - >> app.root = C:/Workspaces/eclipse/.metadata/.plugins/org.eclipse.wst.server.core/tmp0/wtpwebapps/nutzbook
2017-08-01 15:19:10,658 org.nutz.mvc.impl.NutLoading.createIoc(NutLoading.java:376) DEBUG - @IocBy(type=org.nutz.mvc.ioc.provider.ComboIocProvider, args=["*js", "ioc/", "*anno", "net.wendal.nutzbook", "*tx"],init=[])
2017-08-01 15:19:10,868 org.nutz.resource.Scans.scan(Scans.java:274) DEBUG - Found 2 resource by src( ioc/ ) , regex( ^(.+[.])(js|json)$ )
2017-08-01 15:19:10,869 org.nutz.ioc.loader.json.JsonLoader.<init>(JsonLoader.java:49) DEBUG - loading [dao.js]
2017-08-01 15:19:10,882 org.nutz.ioc.loader.json.JsonLoader.<init>(JsonLoader.java:49) DEBUG - loading [quartz.js]
2017-08-01 15:19:10,885 org.nutz.ioc.loader.json.JsonLoader.<init>(JsonLoader.java:57) DEBUG - Loaded 4 bean define from path=[ioc/] --> [scheduler, conf, dao, dataSource]
2017-08-01 15:19:10,915 org.nutz.resource.Scans.scan(Scans.java:274) DEBUG - Found 9 resource by src( net/wendal/nutzbook/ ) , regex( ^.+[.]class$ )
2017-08-01 15:19:10,965 org.nutz.ioc.loader.annotation.AnnotationIocLoader.addClass(AnnotationIocLoader.java:74) DEBUG - Found @IocBean : class net.wendal.nutzbook.module.UserModule
2017-08-01 15:19:11,046 org.nutz.ioc.loader.annotation.AnnotationIocLoader.addClass(AnnotationIocLoader.java:74) DEBUG - Found @IocBean : class net.wendal.nutzbook.quartz.NutQuartzJobFactory
2017-08-01 15:19:11,061 org.nutz.ioc.loader.annotation.AnnotationIocLoader.<init>(AnnotationIocLoader.java:50) INFO - Found 2 classes in 1 base-packages!
beans = ["nutQuartzJobFactory", "userModule"]
2017-08-01 15:19:11,083 org.nutz.ioc.loader.json.JsonLoader.<init>(JsonLoader.java:40) DEBUG - Loaded 5 bean define from reader --
[txREPEATABLE_READ, txSERIALIZABLE, txNONE, txREAD_UNCOMMITTED, txREAD_COMMITTED]
2017-08-01 15:19:11,091 org.nutz.ioc.impl.NutIoc.<init>(NutIoc.java:98) INFO - NutIoc init begin ...
2017-08-01 15:19:11,096 org.nutz.ioc.impl.NutIoc.<init>(NutIoc.java:115) INFO - ... NutIoc init complete
2017-08-01 15:19:11,106 org.nutz.mvc.impl.NutLoading.evalUrlMapping(NutLoading.java:159) INFO - Build URL mapping by org.nutz.mvc.impl.UrlMappingImpl ...
2017-08-01 15:19:11,112 org.nutz.mvc.impl.NutLoading.createViewMakers(NutLoading.java:366) DEBUG - @Views(DefaultViewMaker.class)
2017-08-01 15:19:11,151 org.nutz.resource.Scans.scan(Scans.java:274) DEBUG - Found 1 resource by src( mvc/nutzbook-mvc-chain.js ) , regex( ^(.+[.])(js|json)$ )
2017-08-01 15:19:11,166 org.nutz.mvc.impl.chainconfig.JsonActionChainMakerConfiguretion.<init>(JsonActionChainMakerConfiguretion.java:37) DEBUG - ActionChain Config:
{
"default": {
"ps": ["net.wendal.nutzbook.mvc.LogTimeProcessor", "org.nutz.mvc.impl.processor.UpdateRequestAttributesProcessor", "org.nutz.mvc.impl.processor.EncodingProcessor", "org.nutz.mvc.impl.processor.ModuleProcessor", "org.nutz.mvc.impl.processor.ActionFiltersProcessor", "org.nutz.mvc.impl.processor.AdaptorProcessor", "org.nutz.mvc.impl.processor.MethodInvokeProcessor", "org.nutz.mvc.impl.processor.ViewProcessor"],
"error": "org.nutz.mvc.impl.processor.FailProcessor"
}
}
2017-08-01 15:19:11,167 org.nutz.mvc.impl.NutLoading.createChainMaker(NutLoading.java:263) DEBUG - @ChainBy(org.nutz.mvc.impl.NutActionChainMaker)
2017-08-01 15:19:11,178 org.nutz.mvc.impl.Loadings.scanModules(Loadings.java:154) DEBUG - module class location 'file:/C:/Workspaces/eclipse/.metadata/.plugins/org.eclipse.wst.server.core/tmp0/wtpwebapps/nutzbook/WEB-INF/classes/'
2017-08-01 15:19:11,179 org.nutz.mvc.impl.Loadings.scanModuleInPackage(Loadings.java:184) DEBUG - > scan 'net.wendal.nutzbook'
2017-08-01 15:19:11,199 org.nutz.resource.Scans.scan(Scans.java:274) DEBUG - Found 9 resource by src( net/wendal/nutzbook/ ) , regex( ^.+[.]class$ )
2017-08-01 15:19:11,201 org.nutz.mvc.impl.Loadings.checkModule(Loadings.java:199) DEBUG - >> add 'net.wendal.nutzbook.module.UserModule'
2017-08-01 15:19:11,500 org.nutz.mvc.impl.UrlMappingImpl.print(UrlMappingImpl.java:146) DEBUG - '/user/' >> (UserModule.java:100).index : void | @Ok(jsp:jsp.user.list) @Fail(http:500) | by 1 Filters | (I:UTF-8/O:UTF-8)
2017-08-01 15:19:12,224 org.nutz.mvc.impl.UrlMappingImpl.print(UrlMappingImpl.java:146) DEBUG - '/user/add' >> (UserModule.java:55).add : Object | @Ok(json:{locked:'password|salt',ignoreNull:true}) @Fail(http:500) | by 1 Filters | (I:UTF-8/O:UTF-8)
2017-08-01 15:19:12,227 org.nutz.mvc.impl.UrlMappingImpl.print(UrlMappingImpl.java:146) DEBUG - '/user/count' >> (UserModule.java:32).count : int | @Ok(json:{locked:'password|salt',ignoreNull:true}) @Fail(http:500) | by 1 Filters | (I:UTF-8/O:UTF-8)
2017-08-01 15:19:12,233 org.nutz.mvc.impl.UrlMappingImpl.print(UrlMappingImpl.java:146) DEBUG - '/user/update' >> (UserModule.java:66).update : Object | @Ok(json:{locked:'password|salt',ignoreNull:true}) @Fail(http:500) | by 1 Filters | (I:UTF-8/O:UTF-8)
2017-08-01 15:19:12,247 org.nutz.mvc.impl.UrlMappingImpl.print(UrlMappingImpl.java:146) DEBUG - '/user/delete' >> (UserModule.java:80).delete : Object | @Ok(json:{locked:'password|salt',ignoreNull:true}) @Fail(http:500) | by 1 Filters | (I:UTF-8/O:UTF-8)
2017-08-01 15:19:12,328 org.nutz.mvc.impl.UrlMappingImpl.print(UrlMappingImpl.java:146) DEBUG - '/user/query' >> (UserModule.java:89).query : Object | @Ok(json:{locked:'password|salt',ignoreNull:true}) @Fail(http:500) | by 1 Filters | (I:UTF-8/O:UTF-8)
2017-08-01 15:19:12,331 org.nutz.mvc.impl.UrlMappingImpl.print(UrlMappingImpl.java:146) DEBUG - '/user/error' >> (UserModule.java:137).error : void | @Ok(json:{locked:'password|salt',ignoreNull:true}) @Fail(jsp:jsp.500) | by 0 Filters | (I:UTF-8/O:UTF-8)
2017-08-01 15:19:12,335 org.nutz.mvc.impl.UrlMappingImpl.print(UrlMappingImpl.java:146) DEBUG - '/user/login' >> (UserModule.java:38).login : Object | @Ok(json:{locked:'password|salt',ignoreNull:true}) @Fail(http:500) | by 0 Filters | (I:UTF-8/O:UTF-8)
2017-08-01 15:19:12,342 org.nutz.mvc.impl.UrlMappingImpl.print(UrlMappingImpl.java:146) DEBUG - '/user/logout' >> (UserModule.java:50).logout : void | @Ok(>>:/ ) @Fail(http:500) | by 1 Filters | (I:UTF-8/O:UTF-8)
2017-08-01 15:19:12,343 org.nutz.mvc.impl.NutLoading.evalUrlMapping(NutLoading.java:217) INFO - Found 9 module methods
2017-08-01 15:19:12,343 org.nutz.mvc.impl.NutLoading.evalLocalization(NutLoading.java:303) DEBUG - Localization: org.nutz.mvc.impl.NutMessageLoader('msg/') dft<zh-CN>
2017-08-01 15:19:12,352 org.nutz.resource.Scans.scan(Scans.java:274) DEBUG - Found 1 resource by src( msg/ ) , regex( ^.+[.]properties$ )
2017-08-01 15:19:12,353 org.nutz.mvc.impl.NutMessageLoader.load(NutMessageLoader.java:27) DEBUG - Load Messages in 1 resource : [[File[C:\Workspaces\eclipse\.metadata\.plugins\org.eclipse.wst.server.core\tmp0\wtpwebapps\nutzbook\WEB-INF\classes\msg\zh-CN\user.properties]]]
2017-08-01 15:19:12,357 org.nutz.mvc.impl.NutMessageLoader.load(NutMessageLoader.java:95) DEBUG - Message Loaded, size = 2
2017-08-01 15:19:12,359 org.nutz.mvc.impl.NutLoading.evalSetup(NutLoading.java:271) INFO - Setup application...
2017-08-01 15:19:12,366 org.nutz.ioc.impl.NutIoc.get(NutIoc.java:151) DEBUG - Get 'dao'<interface org.nutz.dao.Dao>
2017-08-01 15:19:12,372 org.nutz.ioc.aop.SimpleAopMaker.<init>(SimpleAopMaker.java:79) DEBUG - Load AopConfigure for anno=org.nutz.ioc.aop.Aop by type=org.nutz.ioc.aop.config.impl.AnnotationAopConfigration
2017-08-01 15:19:12,374 org.nutz.ioc.impl.NutIoc.get(NutIoc.java:177) DEBUG - >> Load definition name=dao
2017-08-01 15:19:12,375 org.nutz.ioc.loader.map.MapLoader.load(MapLoader.java:67) DEBUG - Loading define for name=dao
2017-08-01 15:19:12,396 org.nutz.ioc.loader.combo.ComboIocLoader.load(ComboIocLoader.java:161) DEBUG - Found IocObject(dao) in JsonLoader(paths=[ioc/])
2017-08-01 15:19:12,400 org.nutz.ioc.impl.NutIoc.get(NutIoc.java:209) DEBUG - >> Make...'dao'<interface org.nutz.dao.Dao>
2017-08-01 15:19:12,700 org.nutz.ioc.aop.impl.DefaultMirrorFactory.getMirror(DefaultMirrorFactory.java:70) DEBUG - Load class org.nutz.dao.impl.NutDao without AOP
2017-08-01 15:19:12,703 org.nutz.ioc.impl.ScopeContext.save(ScopeContext.java:64) DEBUG - Save object 'dao' to [app]
2017-08-01 15:19:12,707 org.nutz.ioc.impl.NutIoc.get(NutIoc.java:151) DEBUG - Get 'dataSource'<>
2017-08-01 15:19:12,707 org.nutz.ioc.impl.NutIoc.get(NutIoc.java:177) DEBUG - >> Load definition name=dataSource
2017-08-01 15:19:12,707 org.nutz.ioc.loader.map.MapLoader.load(MapLoader.java:67) DEBUG - Loading define for name=dataSource
2017-08-01 15:19:12,763 org.nutz.ioc.loader.combo.ComboIocLoader.load(ComboIocLoader.java:161) DEBUG - Found IocObject(dataSource) in JsonLoader(paths=[ioc/])
2017-08-01 15:19:12,763 org.nutz.ioc.impl.NutIoc.get(NutIoc.java:209) DEBUG - >> Make...'dataSource'<>
2017-08-01 15:19:12,818 org.nutz.ioc.aop.impl.DefaultMirrorFactory.getMirror(DefaultMirrorFactory.java:70) DEBUG - Load class com.alibaba.druid.pool.DruidDataSource without AOP
2017-08-01 15:19:12,819 org.nutz.ioc.impl.ScopeContext.save(ScopeContext.java:64) DEBUG - Save object 'dataSource' to [app]
2017-08-01 15:19:13,785 org.nutz.ioc.impl.NutIoc.get(NutIoc.java:151) DEBUG - Get 'conf'<>
2017-08-01 15:19:13,787 org.nutz.ioc.impl.NutIoc.get(NutIoc.java:177) DEBUG - >> Load definition name=conf
2017-08-01 15:19:13,787 org.nutz.ioc.loader.map.MapLoader.load(MapLoader.java:67) DEBUG - Loading define for name=conf
2017-08-01 15:19:13,808 org.nutz.ioc.loader.combo.ComboIocLoader.load(ComboIocLoader.java:161) DEBUG - Found IocObject(conf) in JsonLoader(paths=[ioc/])
2017-08-01 15:19:13,808 org.nutz.ioc.impl.NutIoc.get(NutIoc.java:209) DEBUG - >> Make...'conf'<>
2017-08-01 15:19:13,810 org.nutz.ioc.aop.impl.DefaultMirrorFactory.getMirror(DefaultMirrorFactory.java:70) DEBUG - Load class org.nutz.ioc.impl.PropertiesProxy without AOP
2017-08-01 15:19:13,810 org.nutz.ioc.impl.ScopeContext.save(ScopeContext.java:64) DEBUG - Save object 'conf' to [app]
2017-08-01 15:19:14,087 org.nutz.resource.Scans.scan(Scans.java:274) DEBUG - Found 1 resource by src( custom/db.properties ) , regex( ^.+[.]properties$ )
2017-08-01 15:19:14,088 org.nutz.ioc.impl.PropertiesProxy.setPaths(PropertiesProxy.java:113) DEBUG - load properties from File[C:\Workspaces\eclipse\.metadata\.plugins\org.eclipse.wst.server.core\tmp0\wtpwebapps\nutzbook\WEB-INF\classes\custom\db.properties]
2017-08-01 15:19:14,160 org.nutz.ioc.impl.NutIoc.get(NutIoc.java:151) DEBUG - Get 'conf'<>
2017-08-01 15:19:14,161 org.nutz.ioc.impl.NutIoc.get(NutIoc.java:151) DEBUG - Get 'conf'<>
2017-08-01 15:19:14,165 org.nutz.ioc.impl.NutIoc.get(NutIoc.java:151) DEBUG - Get 'conf'<>
2017-08-01 15:19:14,167 org.nutz.ioc.impl.NutIoc.get(NutIoc.java:151) DEBUG - Get 'conf'<>
2017-08-01 15:19:14,406 com.alibaba.druid.pool.DruidDataSource.init(DruidDataSource.java:715) INFO - {dataSource-1} inited
2017-08-01 15:19:14,410 org.nutz.ioc.impl.NutIoc.get(NutIoc.java:151) DEBUG - Get 'dataSource'<>
2017-08-01 15:19:14,768 org.nutz.filepool.NutFilePool.<init>(NutFilePool.java:23) INFO - Init file-pool by: C:\Users\hao/.nutz/tmp/dao/ [200000]
2017-08-01 15:19:14,771 org.nutz.filepool.NutFilePool.<init>(NutFilePool.java:37) DEBUG - file-pool.home: 'C:\Users\hao\.nutz\tmp\dao'
2017-08-01 15:19:14,774 org.nutz.filepool.NutFilePool.<init>(NutFilePool.java:66) INFO - file-pool.cursor: 0
2017-08-01 15:19:15,133 org.nutz.dao.jdbc.Jdbcs.<clinit>(Jdbcs.java:90) DEBUG - Jdbcs init complete
2017-08-01 15:19:15,133 org.nutz.dao.jdbc.Jdbcs.getExpert(Jdbcs.java:103) INFO - Get Connection from DataSource for JdbcExpert, if you lock at here, check your database server and configure
Tue Aug 01 15:19:15 CST 2017 WARN: Establishing SSL connection without server's identity verification is not recommended. According to MySQL 5.5.45+, 5.6.26+ and 5.7.6+ requirements SSL connection must be established by default if explicit option isn't set. For compliance with existing applications not using SSL the verifyServerCertificate property is set to 'false'. You need either to explicitly disable SSL by setting useSSL=false, or set useSSL=true and provide truststore for server certificate verification.
2017-08-01 15:19:15,876 org.nutz.dao.impl.DaoSupport.setDataSource(DaoSupport.java:189) DEBUG - select expert : org.nutz.dao.impl.jdbc.mysql.MysqlJdbcExpert
2017-08-01 15:19:15,891 org.nutz.dao.impl.DaoSupport$1.invoke(DaoSupport.java:200) DEBUG - JDBC Driver --> mysql-connector-java-5.1.40 ( Revision: 402933ef52cad9aa82624e80acbea46e3a701ce6 )
2017-08-01 15:19:15,892 org.nutz.dao.impl.DaoSupport$1.invoke(DaoSupport.java:201) DEBUG - JDBC Name --> MySQL Connector Java
2017-08-01 15:19:15,892 org.nutz.dao.impl.DaoSupport$1.invoke(DaoSupport.java:203) DEBUG - JDBC URL --> jdbc:mysql://127.0.0.1:3306/nutz
2017-08-01 15:19:15,914 org.nutz.dao.impl.jdbc.mysql.MysqlJdbcExpert.checkDataSource(MysqlJdbcExpert.java:212) DEBUG - Mysql : character_set_client=utf8
2017-08-01 15:19:15,916 org.nutz.dao.impl.jdbc.mysql.MysqlJdbcExpert.checkDataSource(MysqlJdbcExpert.java:212) DEBUG - Mysql : character_set_connection=utf8
2017-08-01 15:19:15,916 org.nutz.dao.impl.jdbc.mysql.MysqlJdbcExpert.checkDataSource(MysqlJdbcExpert.java:212) DEBUG - Mysql : character_set_database=utf8
2017-08-01 15:19:15,919 org.nutz.dao.impl.jdbc.mysql.MysqlJdbcExpert.checkDataSource(MysqlJdbcExpert.java:212) DEBUG - Mysql : character_set_filesystem=binary
2017-08-01 15:19:15,920 org.nutz.dao.impl.jdbc.mysql.MysqlJdbcExpert.checkDataSource(MysqlJdbcExpert.java:212) DEBUG - Mysql : character_set_results=
2017-08-01 15:19:15,920 org.nutz.dao.impl.jdbc.mysql.MysqlJdbcExpert.checkDataSource(MysqlJdbcExpert.java:212) DEBUG - Mysql : character_set_server=utf8
2017-08-01 15:19:15,921 org.nutz.dao.impl.jdbc.mysql.MysqlJdbcExpert.checkDataSource(MysqlJdbcExpert.java:212) DEBUG - Mysql : character_set_system=utf8
2017-08-01 15:19:15,922 org.nutz.dao.impl.jdbc.mysql.MysqlJdbcExpert.checkDataSource(MysqlJdbcExpert.java:212) DEBUG - Mysql : character_sets_dir=C:\mysql5.7\share\charsets\
2017-08-01 15:19:15,978 org.nutz.dao.impl.jdbc.mysql.MysqlJdbcExpert.checkDataSource(MysqlJdbcExpert.java:219) DEBUG - Mysql : binlog_format=ROW
2017-08-01 15:19:15,980 org.nutz.dao.impl.jdbc.mysql.MysqlJdbcExpert.checkDataSource(MysqlJdbcExpert.java:226) DEBUG - Mysql : database=nutz
2017-08-01 15:19:15,986 org.nutz.dao.impl.jdbc.mysql.MysqlJdbcExpert.checkDataSource(MysqlJdbcExpert.java:232) DEBUG - Mysql : user=root@localhost
2017-08-01 15:19:16,043 org.nutz.dao.impl.DaoSupport.setDataSource(DaoSupport.java:222) DEBUG - Database info --> MYSQL:[MySQL - 5.7.18]
2017-08-01 15:19:16,069 org.nutz.resource.Scans.scan(Scans.java:274) DEBUG - Found 9 resource by src( net/wendal/nutzbook/ ) , regex( ^.+[.]class$ )
2017-08-01 15:19:16,213 org.nutz.dao.impl.sql.run.NutDaoExecutor.printSQL(NutDaoExecutor.java:388) DEBUG - SELECT COUNT(*) FROM t_user
2017-08-01 15:19:16,220 org.nutz.ioc.impl.NutIoc.get(NutIoc.java:151) DEBUG - Get 'scheduler'<interface org.quartz.Scheduler>
2017-08-01 15:19:16,226 org.nutz.ioc.impl.NutIoc.get(NutIoc.java:177) DEBUG - >> Load definition name=scheduler
2017-08-01 15:19:16,226 org.nutz.ioc.loader.map.MapLoader.load(MapLoader.java:67) DEBUG - Loading define for name=scheduler
2017-08-01 15:19:16,228 org.nutz.ioc.loader.combo.ComboIocLoader.load(ComboIocLoader.java:161) DEBUG - Found IocObject(scheduler) in JsonLoader(paths=[ioc/])
2017-08-01 15:19:16,228 org.nutz.ioc.impl.NutIoc.get(NutIoc.java:209) DEBUG - >> Make...'scheduler'<interface org.quartz.Scheduler>
2017-08-01 15:19:16,228 org.nutz.ioc.impl.ScopeContext.save(ScopeContext.java:64) DEBUG - Save object 'scheduler' to [app]
2017-08-01 15:19:16,359 org.quartz.impl.StdSchedulerFactory.instantiate(StdSchedulerFactory.java:1172) INFO - Using default implementation for ThreadExecutor
2017-08-01 15:19:16,408 org.quartz.core.SchedulerSignalerImpl.<init>(SchedulerSignalerImpl.java:61) INFO - Initialized Scheduler Signaller of type: class org.quartz.core.SchedulerSignalerImpl
2017-08-01 15:19:16,409 org.quartz.core.QuartzScheduler.<init>(QuartzScheduler.java:240) INFO - Quartz Scheduler v.2.2.3 created.
2017-08-01 15:19:16,413 org.quartz.simpl.RAMJobStore.initialize(RAMJobStore.java:155) INFO - RAMJobStore initialized.
2017-08-01 15:19:16,414 org.quartz.core.QuartzScheduler.initialize(QuartzScheduler.java:305) INFO - Scheduler meta-data: Quartz Scheduler (v2.2.3) 'NutzbookScheduler' with instanceId 'NON_CLUSTERED'
Scheduler class: 'org.quartz.core.QuartzScheduler' - running locally.
NOT STARTED.
Currently in standby mode.
Number of jobs executed: 0
Using thread pool 'org.quartz.simpl.SimpleThreadPool' - with 3 threads.
Using job-store 'org.quartz.simpl.RAMJobStore' - which does not support persistence. and is not clustered.
2017-08-01 15:19:16,415 org.quartz.impl.StdSchedulerFactory.instantiate(StdSchedulerFactory.java:1327) INFO - Quartz scheduler 'NutzbookScheduler' initialized from default resource file in Quartz package: 'quartz.properties'
2017-08-01 15:19:16,415 org.quartz.impl.StdSchedulerFactory.instantiate(StdSchedulerFactory.java:1331) INFO - Quartz scheduler version: 2.2.3
2017-08-01 15:19:16,415 org.nutz.ioc.impl.NutIoc.get(NutIoc.java:151) DEBUG - Get 'nutQuartzJobFactory'<>
2017-08-01 15:19:16,417 org.nutz.ioc.impl.NutIoc.get(NutIoc.java:177) DEBUG - >> Load definition name=nutQuartzJobFactory
2017-08-01 15:19:16,417 org.nutz.ioc.loader.combo.ComboIocLoader.load(ComboIocLoader.java:161) DEBUG - Found IocObject(nutQuartzJobFactory) in AnnotationIocLoader(packages=[net.wendal.nutzbook])
2017-08-01 15:19:16,417 org.nutz.ioc.impl.NutIoc.get(NutIoc.java:209) DEBUG - >> Make...'nutQuartzJobFactory'<>
2017-08-01 15:19:16,417 org.nutz.ioc.aop.impl.DefaultMirrorFactory.getMirror(DefaultMirrorFactory.java:70) DEBUG - Load class net.wendal.nutzbook.quartz.NutQuartzJobFactory without AOP
2017-08-01 15:19:16,417 org.nutz.ioc.impl.ScopeContext.save(ScopeContext.java:64) DEBUG - Save object 'nutQuartzJobFactory' to [app]
2017-08-01 15:19:16,603 org.quartz.core.QuartzScheduler.setJobFactory(QuartzScheduler.java:2311) INFO - JobFactory set to: net.wendal.nutzbook.quartz.NutQuartzJobFactory@706a64cc
2017-08-01 15:19:16,604 org.quartz.core.QuartzScheduler.start(QuartzScheduler.java:575) INFO - Scheduler NutzbookScheduler_$_NON_CLUSTERED started.
2017-08-01 15:19:16,604 org.quartz.core.QuartzSchedulerThread.run(QuartzSchedulerThread.java:276) DEBUG - batch acquisition of 0 triggers
2017-08-01 15:19:16,606 org.nutz.mvc.impl.NutLoading.load(NutLoading.java:141) INFO - Nutz.Mvc[nutz] is up in 5956ms
八月 01, 2017 3:19:16 下午 org.apache.coyote.AbstractProtocol start
信息: Starting ProtocolHandler ["http-nio-8080"]
八月 01, 2017 3:19:16 下午 org.apache.coyote.AbstractProtocol start
信息: Starting ProtocolHandler ["ajp-nio-8009"]
八月 01, 2017 3:19:16 下午 org.apache.catalina.startup.Catalina start
信息: Server startup in 11313 ms
2017-08-01 15:19:25,620 org.nutz.mvc.impl.UrlMappingImpl.get(UrlMappingImpl.java:101) DEBUG - Found mapping for [GET] path=/user/logout : UserModule.logout(UserModule.java:50)
2017-08-01 15:19:25,624 org.nutz.ioc.impl.NutIoc.get(NutIoc.java:151) DEBUG - Get 'userModule'<class net.wendal.nutzbook.module.UserModule>
2017-08-01 15:19:25,625 org.nutz.ioc.impl.NutIoc.get(NutIoc.java:177) DEBUG - >> Load definition name=userModule
2017-08-01 15:19:25,625 org.nutz.ioc.loader.combo.ComboIocLoader.load(ComboIocLoader.java:161) DEBUG - Found IocObject(userModule) in AnnotationIocLoader(packages=[net.wendal.nutzbook])
2017-08-01 15:19:25,625 org.nutz.ioc.impl.NutIoc.get(NutIoc.java:209) DEBUG - >> Make...'userModule'<class net.wendal.nutzbook.module.UserModule>
2017-08-01 15:19:25,628 org.nutz.ioc.aop.impl.DefaultMirrorFactory.getMirror(DefaultMirrorFactory.java:70) DEBUG - Load class net.wendal.nutzbook.module.UserModule without AOP
2017-08-01 15:19:25,629 org.nutz.ioc.impl.ScopeContext.save(ScopeContext.java:64) DEBUG - Save object 'userModule' to [app]
2017-08-01 15:19:25,661 org.nutz.ioc.impl.NutIoc.get(NutIoc.java:151) DEBUG - Get 'dao'<interface org.nutz.dao.Dao>
2017-08-01 15:19:25,666 net.wendal.nutzbook.mvc.LogTimeProcessor.process(LogTimeProcessor.java:27) DEBUG - [ GET]URI=/nutzbook/user/logout 45ms
2017-08-01 15:19:31,953 org.nutz.mvc.impl.UrlMappingImpl.get(UrlMappingImpl.java:101) DEBUG - Found mapping for [GET] path=/user/count : UserModule.count(UserModule.java:32)
2017-08-01 15:19:31,955 org.nutz.ioc.impl.NutIoc.get(NutIoc.java:151) DEBUG - Get 'userModule'<class net.wendal.nutzbook.module.UserModule>
2017-08-01 15:19:31,957 net.wendal.nutzbook.mvc.LogTimeProcessor.process(LogTimeProcessor.java:27) DEBUG - [ GET]URI=/nutzbook/user/count 4ms
2017-08-01 15:19:37,767 org.nutz.mvc.impl.UrlMappingImpl.get(UrlMappingImpl.java:101) DEBUG - Found mapping for [POST] path=/user/login : UserModule.login(UserModule.java:38)
2017-08-01 15:19:37,768 org.nutz.ioc.impl.NutIoc.get(NutIoc.java:151) DEBUG - Get 'userModule'<class net.wendal.nutzbook.module.UserModule>
2017-08-01 15:19:37,814 org.nutz.dao.impl.sql.run.NutDaoExecutor.printSQL(NutDaoExecutor.java:388) DEBUG - 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 "
2017-08-01 15:19:37,876 net.wendal.nutzbook.mvc.LogTimeProcessor.process(LogTimeProcessor.java:27) DEBUG - [POST]URI=/nutzbook/user/login 108ms
2017-08-01 15:19:42,810 org.quartz.core.QuartzSchedulerThread.run(QuartzSchedulerThread.java:276) DEBUG - batch acquisition of 0 triggers
2017-08-01 15:19:45,963 org.nutz.mvc.impl.UrlMappingImpl.get(UrlMappingImpl.java:101) DEBUG - Found mapping for [GET] path=/user/count : UserModule.count(UserModule.java:32)
2017-08-01 15:19:45,963 org.nutz.ioc.impl.NutIoc.get(NutIoc.java:151) DEBUG - Get 'userModule'<class net.wendal.nutzbook.module.UserModule>
2017-08-01 15:19:45,964 org.nutz.dao.impl.sql.run.NutDaoExecutor.printSQL(NutDaoExecutor.java:388) DEBUG - SELECT COUNT(*) FROM t_user
2017-08-01 15:19:45,971 net.wendal.nutzbook.mvc.LogTimeProcessor.process(LogTimeProcessor.java:27) DEBUG - [ GET]URI=/nutzbook/user/count 7ms
2017-08-01 15:20:08,847 org.quartz.core.QuartzSchedulerThread.run(QuartzSchedulerThread.java:276) DEBUG - batch acquisition of 0 triggers
/user/login --> /user/count 能显示1, 证明登录是成功的, 看来还是页面没跳转呢
先登录,然后直接敲url访问 http://127.0.0.1:8080/nutzbook/user/ 看看输出啥
index.jsp
<%@ page language="java" contentType="text/html; charset=UTF-8"
pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>NutzBook demo</title>
<!-- 导入jquery -->
<script type="text/javascript" src="http://lib.sinaapp.com/js/jquery/2.0.3/jquery-2.0.3.min.js"></script>
<!-- 把user id复制到一个js变量 -->
<script type="text/javascript">
var me = '<%=session.getAttribute("me") %>';
var base = '${base}';
$(function() {
$("#login_button").click(function() {
$.ajax({
url : base + "/user/login",
type: "POST",
data:$('#loginForm').serialize(),
error: function(request) {
alert("Connection error");
},
dataType:"json",
success: function(data) {
alert(data);
if (data == true) {
alert("登陆成功");
location.reload();
} else {
alert("登陆失败,请检查账号密码")
}
}
});
return false;
});
if (me != "null") {
$("#login_div").hide();
$("#userInfo").html("您的Id是" + me);
$("#user_info_div").show();
} else {
$("#login_div").show();
$("#user_info_div").hide();
}
});
</script>
</head>
<body>
<div id="login_div">
<form action="#" id="loginForm" method="post">
用户名 <input name="name" type="text" value="admin">
密码 <input name="password" type="password" value="123456">
<button id="login_button">提交</button>
</form>
</div>
<div id="user_info_div">
<p id="userInfo"></p>
<a href="${base}/user/logout">登出</a>
</div>
</body>
</html>
list.jsp
<%@ page language="java" contentType="text/html; charset=UTF-8"
pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>NutzBook demo</title>
<!-- 导入jquery -->
<script type="text/javascript" src="http://lib.sinaapp.com/js/jquery/2.0.3/jquery-2.0.3.min.js"></script>
<!-- 把user id复制到一个js变量 -->
<script type="text/javascript">
var me = '<%=session.getAttribute("me") %>';
var base = '${base}';
$(function() {
$("#login_button").click(function() {
$.ajax({
url : base + "/user/login",
type: "POST",
data:$('#loginForm').serialize(),
error: function(request) {
alert("Connection error");
},
dataType:"json",
success: function(data) {
alert(data);
if (data == true) {
alert("登陆成功");
location.reload();
} else {
alert("登陆失败,请检查账号密码")
}
}
});
return false;
});
if (me != "null") {
$("#login_div").hide();
$("#userInfo").html("您的Id是" + me);
$("#user_info_div").show();
} else {
$("#login_div").show();
$("#user_info_div").hide();
}
});
</script>
</head>
<body>
<div id="login_div">
<form action="#" id="loginForm" method="post">
用户名 <input name="name" type="text" value="admin">
密码 <input name="password" type="password" value="123456">
<button id="login_button">提交</button>
</form>
</div>
<div id="user_info_div">
<p id="userInfo"></p>
<a href="${base}/user/logout">登出</a>
</div>
</body>
</html>
话说, 没登录前, 访问的地址不是 http://127.0.0.1:8080/nutzbook/user/ 吗??
不是,访问的是 http://127.0.0.1:8080/nutzbook/
添加回复
请先登陆