我的项目在启动时发现输出这样的信息
None module classes found!!!
但是我在登陆的时候,却发现后台无法匹配路径
org.nutz.mvc.impl.UrlMappingImpl.get(UrlMappingImpl.java:110) - Search mapping for [POST] path=/sys/author/baseuser/doLogin : NOT Action match
这是什么原因 造成的
@SetupBy(value=WendalSetup.class)
@IocBy(type=ComboIocProvider.class,args={"*js", "ioc/",
"*anno", "com.miracle.agile.framework","com.miracle.agile.business",
"*tx", // 锟斤拷锟斤拷锟斤拷锟斤拷 aop
"*async"})
@Modules(scanPackage=true)
public class MainModule {
}
这个就是我入口的方法
package com.miracle.agile.framework;
import org.nutz.mvc.annotation.IocBy;
import org.nutz.mvc.annotation.Modules;
import org.nutz.mvc.annotation.SetupBy;
import org.nutz.mvc.ioc.provider.ComboIocProvider;
@SetupBy(value=WendalSetup.class)
@IocBy(type=ComboIocProvider.class,args={"*js", "ioc/",
"*anno", "com.miracle.agile.framework","com.miracle.agile.business",
"*tx", // 锟斤拷锟斤拷锟斤拷锟斤拷 aop
"*async"})
@Modules(scanPackage=true)
public class MainModule {
}
这个是MainModule的package
package com.miracle.agile.business.controllers.sys.author;
import com.miracle.agile.business.models.sys.author.BaseUser;
import com.miracle.agile.business.services.author.BaseUserService;
import com.miracle.agile.common.annotation.SLog;
import com.miracle.agile.common.base.Result;
import com.miracle.agile.common.filter.PrivateFilter;
import com.miracle.agile.common.page.DataTableColumn;
import com.miracle.agile.common.page.DataTableOrder;
import com.miracle.agile.framework.bean.UserBean;
import com.miracle.agile.framework.util.CommonUtils;
import org.apache.shiro.authz.annotation.RequiresAuthentication;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.nutz.dao.Cnd;
import org.nutz.ioc.loader.annotation.Inject;
import org.nutz.ioc.loader.annotation.IocBean;
import org.nutz.log.Log;
import org.nutz.log.Logs;
import org.nutz.mvc.annotation.*;
import javax.servlet.http.HttpServletRequest;
import java.util.List;
@IocBean
@At("/sys/author/baseuser")
@Filters({ @By(type = PrivateFilter.class)})
public class BaseUserController {
private static final Log log = Logs.get();
@Inject
BaseUserService baseUserService;
@At("")
@Ok("beetl:/sys/author/UserList.jsp")
@RequiresAuthentication
public void index() {
}
@At("/login")
@Ok("json")
@SLog(tag = "Login", msg = "登录")
public String doLogin(@Param("username") String username, @Param("password") String password) {
BaseUser user =baseUserService.VerificationUserInfo(username, password);
if(CommonUtils.isEmpty(user)){
return "10";
}else{
UserBean userBean=baseUserService.doLogin(user.getUserid());
String string="";
}
return "00";
}
@At
@Ok("json")
@RequiresPermissions("platform.a.add")
@SLog(tag = "Add", msg = "Add:base_user")
public Object addDo(@Param("..") BaseUser base_user, HttpServletRequest req) {
try {
baseUserService.insert(base_user);
return Result.success("system.success");
} catch (Exception e) {
return Result.error("system.error");
}
}
@At("/edit/?")
@Ok("beetl:/platform/a/edit.html")
@RequiresAuthentication
public Object edit(String id) {
return baseUserService.fetch(id);
}
@At
@Ok("json")
@RequiresPermissions("platform.a.edit")
@SLog(tag = "Edit", msg = "Edit:base_user")
public Object editDo(@Param("..") BaseUser base_user, HttpServletRequest req) {
try {
baseUserService.updateIgnoreNull(base_user);
return Result.success("system.success");
} catch (Exception e) {
return Result.error("system.error");
}
}
@At({"/delete","/delete/?"})
@Ok("json")
@RequiresPermissions("platform.a.delete")
@SLog(tag = "Delete", msg = "Delete:base_user")
public Object delete(String id,@Param("ids") String[] ids, HttpServletRequest req) {
try {
if(ids!=null&&ids.length>0){
baseUserService.delete(ids);
}else{
baseUserService.delete(id);
}
return Result.success("system.success");
} catch (Exception e) {
return Result.error("system.error");
}
}
@At
@Ok("json:full")
@RequiresAuthentication
public Object data(@Param("length") int length, @Param("start") int start, @Param("draw") int draw, @Param("::order") List<DataTableOrder> order, @Param("::columns") List<DataTableColumn> columns) {
Cnd cnd = Cnd.NEW();
return baseUserService.data(length, start, draw, order, columns, cnd, null);
}
}
改成
// 包含business这个package
@Modules(scanPackages=true, packages={"com.miracle.agile.business"})
// 或者直接指定顶层package
@Modules(scanPackages=true, packages={"com.miracle.agile"})
是改MainModule上的@Modules注解
// 直接指定顶层package
@Modules(scanPackages=true, packages={"com.miracle.agile"})
我改成你说的那样报错
Caused by: java.lang.RuntimeException: Can not eval beetl:/platform/a/index.html("beetl:/platform/a/index.html") View for public void com.miracle.agile.business.controllers.sys.author.BaseModuleController.index()
at org.nutz.lang.Lang.makeThrow(Lang.java:132)
at org.nutz.mvc.view.ViewZone.makeView(ViewZone.java:90)
at org.nutz.mvc.impl.processor.ViewProcessor.evalView(ViewProcessor.java:89)
at org.nutz.mvc.impl.processor.ViewProcessor.init(ViewProcessor.java:31)
at org.nutz.mvc.impl.NutActionChainMaker.eval(NutActionChainMaker.java:38)
at org.nutz.mvc.impl.UrlMappingImpl.add(UrlMappingImpl.java:54)
at org.nutz.mvc.impl.NutLoading.evalUrlMapping(NutLoading.java:201)
at org.nutz.mvc.impl.NutLoading.load(NutLoading.java:108)
... 15 more
2017-05-08 12:05:48,396 org.nutz.mvc.impl.UrlMappingImpl.get(UrlMappingImpl.java:110) - Search mapping for [POST] path=/sys/author/baseuser/doLogin : NOT Action match
现在是这个问题