NutzCN Logo
问答 跟着手册来的,怎么就报错了呢?
发布于 2993天前 作者 qq_b61182f1 1711 次浏览 复制 上一个帖子 下一个帖子
标签:

@At("/user/profile")路径没写错啊,怎么地址栏报404
UserProfileModule类的代码如下:

package net.wendal.nutzbook.module;

import java.util.Date;

import net.wendal.nutzbook.bean.UserProfile;

import org.nutz.dao.FieldFilter;
import org.nutz.dao.util.Daos;
import org.nutz.ioc.loader.annotation.IocBean;
import org.nutz.mvc.Scope;
import org.nutz.mvc.adaptor.JsonAdaptor;
import org.nutz.mvc.annotation.AdaptBy;
import org.nutz.mvc.annotation.At;
import org.nutz.mvc.annotation.Attr;
import org.nutz.mvc.annotation.By;
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
@At("/user/profile")
@Filters(@By(type=CheckSession.class,args={"me","/"}))
public class UserProfileModule extends BaseModule{
	// ext方法会返回一个Dao实例,是对原有dao对象的封装
	@At
	public UserProfile get(@Attr(scope=Scope.SESSION,value="me")int userId){
		UserProfile profile = Daos.ext(dao, FieldFilter.locked(UserProfile.class, "avatar")).fetch(UserProfile.class,userId);
		if(profile==null){
			profile = new UserProfile();
			profile.setUserId(userId);
			profile.setCreateTime(new Date());
			profile.setUpdateTime(new Date());
			dao.insert(profile);
		}
		return profile;
	}
	
	@At
	@AdaptBy(type=JsonAdaptor.class)
	@Ok("void")
	public void update(@Param("..")UserProfile profile,@Attr(scope=Scope.SESSION,value="me")int userId){
		if(profile==null){
			return;
		}
		profile.setUserId(userId);
		profile.setUpdateTime(new Date());
		profile.setAvatar(null);
		UserProfile old = get(userId);
		
		if(old.getEmail()==null){
			profile.setEmailChecked(false);
		}else{
			if(profile.getEmail()==null){
				profile.setEmail(old.getEmail());
				profile.setEmailChecked(old.isEmailChecked());
			}else{
				profile.setEmailChecked(old.isEmailChecked());
			}
		}
		Daos.ext(dao, FieldFilter.create(UserProfile.class, null,"avatar",true)).update(profile);
	}
	
	
}

访问地址为http://localhost:8080/nutzbook/user/profile
服务器打印日志

2016-10-12 13:42:41
[INFO]-[Thread: Thread-2]-[org.apache.shiro.web.env.EnvironmentLoader.initEnvironment()]: Starting Shiro environment initialization.

2016-10-12 13:42:41
[DEBUG]-[Thread: Thread-2]-[org.apache.shiro.web.env.IniWebEnvironment.init()]: Checking any specified config locations.

2016-10-12 13:42:41
[DEBUG]-[Thread: Thread-2]-[org.apache.shiro.web.env.IniWebEnvironment.init()]: No INI instance or config locations specified.  Trying default config locations.

2016-10-12 13:42:41
[DEBUG]-[Thread: Thread-2]-[org.apache.shiro.io.ResourceUtils.loadFromClassPath()]: Opening resource from class path [shiro.ini]

2016-10-12 13:42:41
[DEBUG]-[Thread: Thread-2]-[org.apache.shiro.config.Ini.load()]: Parsing [main]

2016-10-12 13:42:41
[DEBUG]-[Thread: Thread-2]-[org.apache.shiro.config.Ini.load()]: Parsing [urls]

2016-10-12 13:42:41
[DEBUG]-[Thread: Thread-2]-[org.apache.shiro.web.env.IniWebEnvironment.getDefaultIni()]: Discovered non-empty INI configuration at location 'classpath:shiro.ini'.  Using for configuration.

2016-10-12 13:42:41
[DEBUG]-[Thread: Thread-2]-[org.apache.shiro.config.IniFactorySupport.createInstance()]: Creating instance from Ini [sections=urls]

2016-10-12 13:42:41
[DEBUG]-[Thread: Thread-2]-[org.apache.shiro.config.IniFactorySupport.createInstance()]: Creating instance from Ini [sections=urls]

2016-10-12 13:42:41
[DEBUG]-[Thread: Thread-2]-[org.apache.shiro.web.filter.mgt.DefaultFilterChainManager.createChain()]: Creating chain [/*] from String definition [anon]

2016-10-12 13:42:41
[DEBUG]-[Thread: Thread-2]-[org.apache.shiro.web.filter.mgt.DefaultFilterChainManager.applyChainConfig()]: Attempting to apply path [/*] to filter [anon] with config [null]

2016-10-12 13:42:41
[DEBUG]-[Thread: Thread-2]-[org.apache.shiro.web.env.EnvironmentLoader.initEnvironment()]: Published WebEnvironment as ServletContext attribute with name [org.apache.shiro.web.env.EnvironmentLoader.ENVIRONMENT_ATTRIBUTE_KEY]

2016-10-12 13:42:41
[INFO]-[Thread: Thread-2]-[org.apache.shiro.web.env.EnvironmentLoader.initEnvironment()]: Shiro environment initialized in 75 ms.

2016-10-12 13:42:41
[INFO]-[Thread: Thread-2]-[org.nutz.mvc.NutFilter._init()]: NutFilter[nutz] starting ...

2016-10-12 13:42:41
[DEBUG]-[Thread: Thread-2]-[org.nutz.resource.Scans.<init>()]: Locations for Scans:
[Dir[path=E:\work\eclipse], Jar[path=D:\hbk\wlkj\.metadata\.plugins\org.eclipse.wst.server.core\tmp1\wtpwebapps\nutzbook\WEB-INF\lib\nutz-1.r.58.jar], Dir[path=D:\hbk\wlkj\.metadata\.plugins\org.eclipse.wst.server.core\tmp1\wtpwebapps\nutzbook\WEB-INF\classes], Jar[path=D:\hbk\tomcat7\bin\bootstrap.jar], Jar[path=D:\hbk\tomcat7\bin\tomcat-juli.jar], Jar[path=C:\Program Files (x86)\Java\jdk1.7.0_13\lib\tools.jar]]

2016-10-12 13:42:41
[DEBUG]-[Thread: Thread-2]-[org.nutz.resource.Scans.init()]: Locations for Scans:
{E:\work\eclipse=Dir[path=E:\work\eclipse], D:\hbk\wlkj\.metadata\.plugins\org.eclipse.wst.server.core\tmp1\wtpwebapps\nutzbook\WEB-INF\lib\nutz-1.r.58.jar=Jar[path=D:\hbk\wlkj\.metadata\.plugins\org.eclipse.wst.server.core\tmp1\wtpwebapps\nutzbook\WEB-INF\lib\nutz-1.r.58.jar], D:\hbk\wlkj\.metadata\.plugins\org.eclipse.wst.server.core\tmp1\wtpwebapps\nutzbook\WEB-INF\classes=Dir[path=D:\hbk\wlkj\.metadata\.plugins\org.eclipse.wst.server.core\tmp1\wtpwebapps\nutzbook\WEB-INF\classes], D:\hbk\tomcat7\bin\bootstrap.jar=Jar[path=D:\hbk\tomcat7\bin\bootstrap.jar], D:\hbk\tomcat7\bin\tomcat-juli.jar=Jar[path=D:\hbk\tomcat7\bin\tomcat-juli.jar], C:\Program Files (x86)\Java\jdk1.7.0_13\lib\tools.jar=Jar[path=C:\Program Files (x86)\Java\jdk1.7.0_13\lib\tools.jar], D:\hbk\wlkj\.metadata\.plugins\org.eclipse.wst.server.core\tmp1\wtpwebapps\nutzbook\WEB-INF\lib\druid-0.2.6.jar=Jar[path=D:\hbk\wlkj\.metadata\.plugins\org.eclipse.wst.server.core\tmp1\wtpwebapps\nutzbook\WEB-INF\lib\druid-0.2.6.jar], D:\hbk\wlkj\.metadata\.plugins\org.eclipse.wst.server.core\tmp1\wtpwebapps\nutzbook\WEB-INF\lib\log4j-1.2.16.jar=Jar[path=D:\hbk\wlkj\.metadata\.plugins\org.eclipse.wst.server.core\tmp1\wtpwebapps\nutzbook\WEB-INF\lib\log4j-1.2.16.jar], D:\hbk\wlkj\.metadata\.plugins\org.eclipse.wst.server.core\tmp1\wtpwebapps\nutzbook\WEB-INF\lib\slf4j-log4j12-1.7.2.jar=Jar[path=D:\hbk\wlkj\.metadata\.plugins\org.eclipse.wst.server.core\tmp1\wtpwebapps\nutzbook\WEB-INF\lib\slf4j-log4j12-1.7.2.jar], D:\hbk\wlkj\.metadata\.plugins\org.eclipse.wst.server.core\tmp1\wtpwebapps\nutzbook\WEB-INF\lib\shiro-all-1.2.3.jar=Jar[path=D:\hbk\wlkj\.metadata\.plugins\org.eclipse.wst.server.core\tmp1\wtpwebapps\nutzbook\WEB-INF\lib\shiro-all-1.2.3.jar], D:\hbk\wlkj\.metadata\.plugins\org.eclipse.wst.server.core\tmp1\wtpwebapps\nutzbook\WEB-INF\lib\commons-logging-1.1.3.jar=Jar[path=D:\hbk\wlkj\.metadata\.plugins\org.eclipse.wst.server.core\tmp1\wtpwebapps\nutzbook\WEB-INF\lib\commons-logging-1.1.3.jar], D:\hbk\wlkj\.metadata\.plugins\org.eclipse.wst.server.core\tmp1\wtpwebapps\nutzbook\WEB-INF\lib\nutz-integration-shiro-1.b.53.r2.jar=Jar[path=D:\hbk\wlkj\.metadata\.plugins\org.eclipse.wst.server.core\tmp1\wtpwebapps\nutzbook\WEB-INF\lib\nutz-integration-shiro-1.b.53.r2.jar], D:\hbk\wlkj\.metadata\.plugins\org.eclipse.wst.server.core\tmp1\wtpwebapps\nutzbook\WEB-INF\lib\commons-beanutils-1.9.1.jar=Jar[path=D:\hbk\wlkj\.metadata\.plugins\org.eclipse.wst.server.core\tmp1\wtpwebapps\nutzbook\WEB-INF\lib\commons-beanutils-1.9.1.jar], D:\hbk\wlkj\.metadata\.plugins\org.eclipse.wst.server.core\tmp1\wtpwebapps\nutzbook\WEB-INF\lib\slf4j-api-1.7.2.jar=Jar[path=D:\hbk\wlkj\.metadata\.plugins\org.eclipse.wst.server.core\tmp1\wtpwebapps\nutzbook\WEB-INF\lib\slf4j-api-1.7.2.jar], D:\hbk\wlkj\.metadata\.plugins\org.eclipse.wst.server.core\tmp1\wtpwebapps\nutzbook\WEB-INF\lib\mysql-connector-java-5.1.20-bin.jar=Jar[path=D:\hbk\wlkj\.metadata\.plugins\org.eclipse.wst.server.core\tmp1\wtpwebapps\nutzbook\WEB-INF\lib\mysql-connector-java-5.1.20-bin.jar]}

2016-10-12 13:42:41
[DEBUG]-[Thread: Thread-2]-[org.nutz.castor.Castors.reload()]: Using 94 castor for Castors

2016-10-12 13:42:41
[DEBUG]-[Thread: Thread-2]-[org.nutz.mvc.config.AbstractNutConfig.createLoading()]: Loading by class org.nutz.mvc.impl.NutLoading

2016-10-12 13:42:41
[INFO]-[Thread: Thread-2]-[org.nutz.mvc.impl.NutLoading.load()]: Nutz Version : 1.r.58 

2016-10-12 13:42:41
[INFO]-[Thread: Thread-2]-[org.nutz.mvc.impl.NutLoading.load()]: Nutz.Mvc[nutz] is initializing ...

2016-10-12 13:42:41
[DEBUG]-[Thread: Thread-2]-[org.nutz.mvc.impl.NutLoading.load()]: Web Container Information:

2016-10-12 13:42:41
[DEBUG]-[Thread: Thread-2]-[org.nutz.mvc.impl.NutLoading.load()]:  - Default Charset : UTF-8

2016-10-12 13:42:41
[DEBUG]-[Thread: Thread-2]-[org.nutz.mvc.impl.NutLoading.load()]:  - Current . path  : E:\work\eclipse\.

2016-10-12 13:42:41
[DEBUG]-[Thread: Thread-2]-[org.nutz.mvc.impl.NutLoading.load()]:  - Java Version    : 1.7.0_13

2016-10-12 13:42:41
[DEBUG]-[Thread: Thread-2]-[org.nutz.mvc.impl.NutLoading.load()]:  - File separator  : \

2016-10-12 13:42:41
[DEBUG]-[Thread: Thread-2]-[org.nutz.mvc.impl.NutLoading.load()]:  - Timezone        : Asia/Shanghai

2016-10-12 13:42:41
[DEBUG]-[Thread: Thread-2]-[org.nutz.mvc.impl.NutLoading.load()]:  - OS              : Windows 7 x86

2016-10-12 13:42:41
[DEBUG]-[Thread: Thread-2]-[org.nutz.mvc.impl.NutLoading.load()]:  - ServerInfo      : Apache Tomcat/7.0.12

2016-10-12 13:42:41
[DEBUG]-[Thread: Thread-2]-[org.nutz.mvc.impl.NutLoading.load()]:  - Servlet API     : 3.0

2016-10-12 13:42:41
[DEBUG]-[Thread: Thread-2]-[org.nutz.mvc.impl.NutLoading.load()]:  - ContextPath     : /nutzbook

2016-10-12 13:42:41
[DEBUG]-[Thread: Thread-2]-[org.nutz.mvc.impl.NutLoading.load()]:  - context.tempdir : D:\hbk\wlkj\.metadata\.plugins\org.eclipse.wst.server.core\tmp1\work\Catalina\localhost\nutzbook

2016-10-12 13:42:41
[DEBUG]-[Thread: Thread-2]-[org.nutz.mvc.impl.NutLoading.load()]:  - MainModule      : net.wendal.nutzbook.MainModule

2016-10-12 13:42:41
[DEBUG]-[Thread: Thread-2]-[org.nutz.mvc.impl.NutLoading.createContext()]: >> app.root = D:/hbk/wlkj/.metadata/.plugins/org.eclipse.wst.server.core/tmp1/wtpwebapps/nutzbook

2016-10-12 13:42:41
[DEBUG]-[Thread: Thread-2]-[org.nutz.mvc.impl.NutLoading.createIoc()]: @IocBy(type=org.nutz.mvc.ioc.provider.ComboIocProvider, args=["*js", "ioc/", "*anno", "net.wendal.nutzbook", "*tx"],init=[])

2016-10-12 13:42:41
[DEBUG]-[Thread: Thread-2]-[org.nutz.resource.Scans.scan()]: Found 1 resource by src( ioc/ ) , regex( ^(.+[.])(js|json)$ )

2016-10-12 13:42:41
[DEBUG]-[Thread: Thread-2]-[org.nutz.ioc.loader.json.JsonLoader.<init>()]: loading ioc js config from [dao.js]

2016-10-12 13:42:41
[DEBUG]-[Thread: Thread-2]-[org.nutz.ioc.loader.json.JsonLoader.<init>()]: Loaded 3 bean define from path=[ioc/] --> [dataSource, dao, conf]

2016-10-12 13:42:41
[DEBUG]-[Thread: Thread-2]-[org.nutz.resource.Scans.scan()]: Found 10 resource by src( net/wendal/nutzbook/ ) , regex( ^.+[.]class$ )

2016-10-12 13:42:41
[DEBUG]-[Thread: Thread-2]-[org.nutz.ioc.loader.annotation.AnnotationIocLoader.addClass()]: Found @IocBean : class net.wendal.nutzbook.module.UserModule

2016-10-12 13:42:41
[DEBUG]-[Thread: Thread-2]-[org.nutz.ioc.loader.annotation.AnnotationIocLoader.addClass()]: Found @IocBean : class net.wendal.nutzbook.module.UserProfileModule

2016-10-12 13:42:41
[INFO]-[Thread: Thread-2]-[org.nutz.ioc.loader.annotation.AnnotationIocLoader.<init>()]: Found 2 classes in 1 base-packages!
beans = ["userProfileModule", "userModule"]

2016-10-12 13:42:41
[DEBUG]-[Thread: Thread-2]-[org.nutz.ioc.loader.json.JsonLoader.<init>()]: Loaded 5 bean define from reader --
[txREPEATABLE_READ, txREAD_COMMITTED, txNONE, txSERIALIZABLE, txREAD_UNCOMMITTED]

2016-10-12 13:42:41
[INFO]-[Thread: Thread-2]-[org.nutz.ioc.impl.NutIoc.<init>()]: NutIoc init begin ...

2016-10-12 13:42:41
[INFO]-[Thread: Thread-2]-[org.nutz.ioc.impl.NutIoc.<init>()]: ... NutIoc init complete

2016-10-12 13:42:41
[INFO]-[Thread: Thread-2]-[org.nutz.mvc.impl.NutLoading.evalUrlMapping()]: Build URL mapping by org.nutz.mvc.impl.UrlMappingImpl ...

2016-10-12 13:42:41
[DEBUG]-[Thread: Thread-2]-[org.nutz.mvc.impl.NutLoading.createViewMakers()]: @Views(DefaultViewMaker.class)

2016-10-12 13:42:41
[DEBUG]-[Thread: Thread-2]-[org.nutz.resource.Scans.scan()]: Found 1 resource by src( mvc/nutzbook-mvc-chain.js ) , regex( ^(.+[.])(js|json)$ )

2016-10-12 13:42:41
[DEBUG]-[Thread: Thread-2]-[org.nutz.mvc.impl.chainconfig.JsonActionChainMakerConfiguretion.<init>()]: 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"
   }
}

2016-10-12 13:42:41
[DEBUG]-[Thread: Thread-2]-[org.nutz.mvc.impl.NutLoading.createChainMaker()]: @ChainBy(org.nutz.mvc.impl.NutActionChainMaker)

2016-10-12 13:42:41
[DEBUG]-[Thread: Thread-2]-[org.nutz.mvc.impl.Loadings.scanModules()]: module class location 'file:/D:/hbk/wlkj/.metadata/.plugins/org.eclipse.wst.server.core/tmp1/wtpwebapps/nutzbook/WEB-INF/classes/net/wendal/nutzbook/MainModule.class'

2016-10-12 13:42:41
[DEBUG]-[Thread: Thread-2]-[org.nutz.mvc.impl.Loadings.scanModuleInPackage()]:  > scan 'net.wendal.nutzbook'

2016-10-12 13:42:41
[DEBUG]-[Thread: Thread-2]-[org.nutz.resource.Scans.scan()]: Found 10 resource by src( net/wendal/nutzbook/ ) , regex( ^.+[.]class$ )

2016-10-12 13:42:41
[DEBUG]-[Thread: Thread-2]-[org.nutz.mvc.impl.Loadings.checkModule()]:    >> add 'net.wendal.nutzbook.module.UserModule'

2016-10-12 13:42:41
[DEBUG]-[Thread: Thread-2]-[org.nutz.mvc.impl.Loadings.checkModule()]:    >> add 'net.wendal.nutzbook.module.UserProfileModule'

2016-10-12 13:42:41
[DEBUG]-[Thread: Thread-2]-[org.nutz.mvc.impl.UrlMappingImpl.print()]:    '/user/login'               >> UserModule.login(...)          : Object     | @Ok(json:{locked:'password|salt',ignoreNull:true}) @Fail(http:500) | by 0 Filters | (I:UTF-8/O:UTF-8)

2016-10-12 13:42:41
[DEBUG]-[Thread: Thread-2]-[org.nutz.mvc.impl.UrlMappingImpl.print()]:    '/user/logout'              >> UserModule.logout(...)         : void       | @Ok(>>:/ ) @Fail(http:500) | by 1 Filters | (I:UTF-8/O:UTF-8)

2016-10-12 13:42:41
[DEBUG]-[Thread: Thread-2]-[org.nutz.mvc.impl.UrlMappingImpl.print()]:    '/user/me'                  >> UserModule.me(...)             : User       | @Ok(json:{locked:'password|salt',ignoreNull:true}) @Fail(http:500) | by 1 Filters | (I:UTF-8/O:UTF-8)

2016-10-12 13:42:41
[DEBUG]-[Thread: Thread-2]-[org.nutz.mvc.impl.UrlMappingImpl.print()]:    '/user/add'                 >> UserModule.add(...)            : Object     | @Ok(json:{locked:'password|salt',ignoreNull:true}) @Fail(http:500) | by 1 Filters | (I:UTF-8/O:UTF-8)

2016-10-12 13:42:41
[DEBUG]-[Thread: Thread-2]-[org.nutz.mvc.impl.UrlMappingImpl.print()]:    '/user/count'               >> UserModule.count(...)          : int        | @Ok(json:{locked:'password|salt',ignoreNull:true}) @Fail(http:500) | by 1 Filters | (I:UTF-8/O:UTF-8)

2016-10-12 13:42:41
[DEBUG]-[Thread: Thread-2]-[org.nutz.mvc.impl.UrlMappingImpl.print()]:    '/user/delete'              >> UserModule.delete(...)         : Object     | @Ok(json:{locked:'password|salt',ignoreNull:true}) @Fail(http:500) | by 1 Filters | (I:UTF-8/O:UTF-8)

2016-10-12 13:42:41
[DEBUG]-[Thread: Thread-2]-[org.nutz.mvc.impl.UrlMappingImpl.print()]:    '/user/query'               >> UserModule.query(...)          : Object     | @Ok(json:{locked:'password|salt',ignoreNull:true}) @Fail(http:500) | by 1 Filters | (I:UTF-8/O:UTF-8)

2016-10-12 13:42:41
[DEBUG]-[Thread: Thread-2]-[org.nutz.mvc.impl.UrlMappingImpl.print()]:    '/user/'                    >> UserModule.index(...)          : void       | @Ok(jsp:jsp.user.list) @Fail(http:500) | by 1 Filters | (I:UTF-8/O:UTF-8)

2016-10-12 13:42:41
[DEBUG]-[Thread: Thread-2]-[org.nutz.mvc.impl.UrlMappingImpl.print()]:    '/user/update'              >> UserModule.update(...)         : Object     | @Ok(json:{locked:'password|salt',ignoreNull:true}) @Fail(http:500) | by 1 Filters | (I:UTF-8/O:UTF-8)

2016-10-12 13:42:41
[DEBUG]-[Thread: Thread-2]-[org.nutz.mvc.impl.UrlMappingImpl.print()]:    '/user/profile/get'         >> UserProfileModule.get(...)     : UserProfile | @Ok(null ) @Fail(null ) | by 1 Filters | (I:UTF-8/O:UTF-8)

2016-10-12 13:42:41
[DEBUG]-[Thread: Thread-2]-[org.nutz.mvc.impl.UrlMappingImpl.print()]:    '/user/profile/update'      >> UserProfileModule.update(...)  : void       | @Ok(void ) @Fail(null ) | by 1 Filters | (I:UTF-8/O:UTF-8)

2016-10-12 13:42:41
[INFO]-[Thread: Thread-2]-[org.nutz.mvc.impl.NutLoading.evalUrlMapping()]: Found 11 module methods

2016-10-12 13:42:41
[DEBUG]-[Thread: Thread-2]-[org.nutz.mvc.impl.NutLoading.evalLocalization()]: Localization: org.nutz.mvc.impl.NutMessageLoader('msg/')  dft<zh-CN>

2016-10-12 13:42:41
[DEBUG]-[Thread: Thread-2]-[org.nutz.resource.Scans.scan()]: Found 1 resource by src( msg/ ) , regex( ^.+[.]properties$ )

2016-10-12 13:42:41
[DEBUG]-[Thread: Thread-2]-[org.nutz.mvc.impl.NutMessageLoader.load()]: Load Messages in 1 resource : [[NutResource[zh-CN/user.properties]]]

2016-10-12 13:42:41
[DEBUG]-[Thread: Thread-2]-[org.nutz.mvc.impl.NutMessageLoader.load()]: Message Loaded, size = 2

2016-10-12 13:42:41
[INFO]-[Thread: Thread-2]-[org.nutz.mvc.impl.NutLoading.evalSetup()]: Setup application...

2016-10-12 13:42:41
[DEBUG]-[Thread: Thread-2]-[org.nutz.ioc.impl.NutIoc.get()]: Get 'dao'<interface org.nutz.dao.Dao>

2016-10-12 13:42:41
[DEBUG]-[Thread: Thread-2]-[org.nutz.ioc.aop.SimpleAopMaker.<init>()]: Load AopConfigure for anno=org.nutz.ioc.aop.Aop by type=org.nutz.ioc.aop.config.impl.AnnotationAopConfigration

2016-10-12 13:42:41
[DEBUG]-[Thread: Thread-2]-[org.nutz.ioc.impl.NutIoc.get()]: 	 >> Load definition name=dao

2016-10-12 13:42:41
[DEBUG]-[Thread: Thread-2]-[org.nutz.ioc.loader.map.MapLoader.load()]: Loading define for name=dao

2016-10-12 13:42:41
[DEBUG]-[Thread: Thread-2]-[org.nutz.ioc.loader.combo.ComboIocLoader.load()]: Found IocObject(dao) in JsonLoader(paths=[ioc/])

2016-10-12 13:42:41
[DEBUG]-[Thread: Thread-2]-[org.nutz.ioc.impl.NutIoc.get()]: 	 >> Make...'dao'<interface org.nutz.dao.Dao>

2016-10-12 13:42:41
[DEBUG]-[Thread: Thread-2]-[org.nutz.ioc.aop.impl.DefaultMirrorFactory.getMirror()]: Load class org.nutz.dao.impl.NutDao without AOP

2016-10-12 13:42:41
[DEBUG]-[Thread: Thread-2]-[org.nutz.ioc.impl.ScopeContext.save()]: Save object 'dao' to [app] 

2016-10-12 13:42:41
[DEBUG]-[Thread: Thread-2]-[org.nutz.ioc.impl.NutIoc.get()]: Get 'dataSource'<>

2016-10-12 13:42:41
[DEBUG]-[Thread: Thread-2]-[org.nutz.ioc.impl.NutIoc.get()]: 	 >> Load definition name=dataSource

2016-10-12 13:42:41
[DEBUG]-[Thread: Thread-2]-[org.nutz.ioc.loader.map.MapLoader.load()]: Loading define for name=dataSource

2016-10-12 13:42:41
[DEBUG]-[Thread: Thread-2]-[org.nutz.ioc.loader.combo.ComboIocLoader.load()]: Found IocObject(dataSource) in JsonLoader(paths=[ioc/])

2016-10-12 13:42:41
[DEBUG]-[Thread: Thread-2]-[org.nutz.ioc.impl.NutIoc.get()]: 	 >> Make...'dataSource'<>

2016-10-12 13:42:41
[DEBUG]-[Thread: Thread-2]-[org.nutz.ioc.aop.impl.DefaultMirrorFactory.getMirror()]: Load class com.alibaba.druid.pool.DruidDataSource without AOP

2016-10-12 13:42:41
[DEBUG]-[Thread: Thread-2]-[org.nutz.ioc.impl.ScopeContext.save()]: Save object 'dataSource' to [app] 

2016-10-12 13:42:41
[DEBUG]-[Thread: Thread-2]-[org.nutz.ioc.impl.NutIoc.get()]: Get 'conf'<>

2016-10-12 13:42:41
[DEBUG]-[Thread: Thread-2]-[org.nutz.ioc.impl.NutIoc.get()]: 	 >> Load definition name=conf

2016-10-12 13:42:41
[DEBUG]-[Thread: Thread-2]-[org.nutz.ioc.loader.map.MapLoader.load()]: Loading define for name=conf

2016-10-12 13:42:41
[DEBUG]-[Thread: Thread-2]-[org.nutz.ioc.loader.combo.ComboIocLoader.load()]: Found IocObject(conf) in JsonLoader(paths=[ioc/])

2016-10-12 13:42:41
[DEBUG]-[Thread: Thread-2]-[org.nutz.ioc.impl.NutIoc.get()]: 	 >> Make...'conf'<>

2016-10-12 13:42:41
[DEBUG]-[Thread: Thread-2]-[org.nutz.ioc.aop.impl.DefaultMirrorFactory.getMirror()]: Load class org.nutz.ioc.impl.PropertiesProxy without AOP

2016-10-12 13:42:41
[DEBUG]-[Thread: Thread-2]-[org.nutz.ioc.impl.ScopeContext.save()]: Save object 'conf' to [app] 

2016-10-12 13:42:41
[DEBUG]-[Thread: Thread-2]-[org.nutz.resource.Scans.scan()]: Found 1 resource by src( custom/db.properties ) , regex( ^.+[.]properties$ )

2016-10-12 13:42:41
[DEBUG]-[Thread: Thread-2]-[org.nutz.ioc.impl.NutIoc.get()]: Get 'conf'<>

2016-10-12 13:42:41
[DEBUG]-[Thread: Thread-2]-[org.nutz.ioc.impl.NutIoc.get()]: Get 'conf'<>

2016-10-12 13:42:41
[DEBUG]-[Thread: Thread-2]-[org.nutz.ioc.impl.NutIoc.get()]: Get 'conf'<>

2016-10-12 13:42:41
[DEBUG]-[Thread: Thread-2]-[org.nutz.ioc.impl.NutIoc.get()]: Get 'conf'<>

2016-10-12 13:42:41
[INFO]-[Thread: Thread-2]-[com.alibaba.druid.pool.DruidDataSource.init()]: {dataSource-1} inited

2016-10-12 13:42:41
[DEBUG]-[Thread: Thread-2]-[org.nutz.ioc.impl.NutIoc.get()]: Get 'dataSource'<>

2016-10-12 13:42:41
[DEBUG]-[Thread: Thread-2]-[org.nutz.dao.impl.NutDao.<init>()]: NutDao[_selfId=0] init ...

2016-10-12 13:42:41
[INFO]-[Thread: Thread-2]-[org.nutz.filepool.NutFilePool.<init>()]: Init file-pool by: C:\Users\yangfeng/.nutz/tmp/dao/ [200000]

2016-10-12 13:42:41
[DEBUG]-[Thread: Thread-2]-[org.nutz.filepool.NutFilePool.<init>()]: file-pool.home: 'C:\Users\yangfeng\.nutz\tmp\dao'

2016-10-12 13:42:41
[INFO]-[Thread: Thread-2]-[org.nutz.filepool.NutFilePool.<init>()]: file-pool.cursor: 0

2016-10-12 13:42:41
[DEBUG]-[Thread: Thread-2]-[org.nutz.dao.jdbc.Jdbcs.<clinit>()]: Jdbcs init complete

2016-10-12 13:42:41
[INFO]-[Thread: Thread-2]-[org.nutz.dao.jdbc.Jdbcs.getExpert()]: Get Connection from DataSource for JdbcExpert, if I lock at here, check your database server and configure

2016-10-12 13:42:42
[DEBUG]-[Thread: Thread-2]-[org.nutz.dao.impl.DaoSupport$1.invoke()]: JDBC Driver --> mysql-connector-java-5.1.20 ( Revision: tonci.grgin@oracle.com-20111003110438-qfydx066wsbydkbw )

2016-10-12 13:42:42
[DEBUG]-[Thread: Thread-2]-[org.nutz.dao.impl.DaoSupport$1.invoke()]: JDBC Name   --> MySQL-AB JDBC Driver

2016-10-12 13:42:42
[DEBUG]-[Thread: Thread-2]-[org.nutz.dao.impl.DaoSupport$1.invoke()]: JDBC URL    --> jdbc:mysql://192.168.8.220:3306/nutzbook

2016-10-12 13:42:42
[DEBUG]-[Thread: Thread-2]-[org.nutz.dao.impl.DaoSupport$1.invoke()]: Mysql : character_set_client=utf8mb4

2016-10-12 13:42:42
[DEBUG]-[Thread: Thread-2]-[org.nutz.dao.impl.DaoSupport$1.invoke()]: Mysql : character_set_connection=utf8mb4

2016-10-12 13:42:42
[DEBUG]-[Thread: Thread-2]-[org.nutz.dao.impl.DaoSupport$1.invoke()]: Mysql : character_set_database=utf8

2016-10-12 13:42:42
[DEBUG]-[Thread: Thread-2]-[org.nutz.dao.impl.DaoSupport$1.invoke()]: Mysql : character_set_filesystem=binary

2016-10-12 13:42:42
[DEBUG]-[Thread: Thread-2]-[org.nutz.dao.impl.DaoSupport$1.invoke()]: Mysql : character_set_results=

2016-10-12 13:42:42
[DEBUG]-[Thread: Thread-2]-[org.nutz.dao.impl.DaoSupport$1.invoke()]: Mysql : character_set_server=utf8

2016-10-12 13:42:42
[DEBUG]-[Thread: Thread-2]-[org.nutz.dao.impl.DaoSupport$1.invoke()]: Mysql : character_set_system=utf8

2016-10-12 13:42:42
[DEBUG]-[Thread: Thread-2]-[org.nutz.dao.impl.DaoSupport$1.invoke()]: Mysql : character_sets_dir=/usr/local/mysql/share/charsets/

2016-10-12 13:42:42
[DEBUG]-[Thread: Thread-2]-[org.nutz.dao.impl.DaoSupport$1.invoke()]: Mysql : database=nutzbook

2016-10-12 13:42:42
[DEBUG]-[Thread: Thread-2]-[org.nutz.dao.impl.DaoSupport$1.invoke()]: Mysql : user=root@192.168.8.133

2016-10-12 13:42:42
[DEBUG]-[Thread: Thread-2]-[org.nutz.dao.impl.DaoSupport.setDataSource()]: Database info --> MYSQL:[MySQL - 5.5.27-log]

2016-10-12 13:42:42
[DEBUG]-[Thread: Thread-2]-[org.nutz.resource.Scans.scan()]: Found 10 resource by src( net/wendal/nutzbook/ ) , regex( ^.+[.]class$ )

2016-10-12 13:42:42
[DEBUG]-[Thread: Thread-2]-[org.nutz.dao.impl.sql.run.NutDaoExecutor.printSQL()]: SELECT COUNT(*) FROM t_user 

2016-10-12 13:42:42
2016-10-12 13:43:48
[DEBUG]-[Thread: "http-bio-8080"-exec-3]-[org.nutz.mvc.impl.UrlMappingImpl.get()]: Search mapping for path=/user/profile : NOT Action match
3 回复

就你贴的UserProfileModule里面就2个方法

get方法映射为 /user/profile/get

update方法映射为 /user/profile/update

所以, 访问 /user/profile当然是404咯

@wendal 谢谢,嗯。我还有一个问题想问:之前UserModule里有At("/user")注解, 其他模块还可以继续At("/user/XXX")????就是含有相同的前缀,在映射上XXX不会处理为UserModule里的方法么?是源码当中做了相关的处理对吧

@qq_b61182f1 可以的,只要完整路径不冲突就行。一般建议独占,呵呵

添加回复
请先登陆
回到顶部