oojdon的jdonmvc的demo访问根目录报错了,有经验的来解答下什么情况

com.jdon.mvc.rs.InvalidResourceException: can't find resource for:[/] by http verb[get]please check your resource design!

import com.jdon.mvc.annotations.In;
import com.jdon.mvc.annotations.Path;
import com.jdon.mvc.http.FormFile;
import com.jdon.mvc.http.RequestBody;
import com.jdon.mvc.represent.Html;
import com.jdon.mvc.represent.Json;
import com.jdon.mvc.represent.Represent;

public class TestController {

private static DB db = new DB();

@In
private RequestBody body;

@Path("/")
public Represent index() {
return new Html("index");
}

你好,是怎么运行的?tomcat?还是maven插件?

gradle,maven,jetty @oojdon
[该贴被tecentIDE26FC于2015-03-04 16:47修改过]

转成小写,再操作,也没啥问题啊,为什么就是找不到资源呢?
public DefaultResourceMatcher(Handler handler, List<String> keys) {
Method m = handler.getMethod();
Path path = m.getAnnotation(Path.class);
String definePath = path.value();
String url = definePath;
String lowerPath = definePath.toLowerCase();
//闀垮害澶т簬4涔熷氨鏄痝et:鐨勯暱搴︼紝寮�濮嬫彁鍙栧姩璇�
if (lowerPath.length() > 4) {
if (lowerPath.startsWith("get:") || lowerPath.startsWith("post:") || lowerPath.startsWith("put:") || lowerPath.startsWith("delete:")) {
verb = lowerPath.substring(0, lowerPath.indexOf(":"));
url = definePath.substring(lowerPath.indexOf(":") + 1);
}
}

if (!url.startsWith("/")) {
url = "/" + url;
}
ResourcePatternBuilder builder = new ResourcePatternBuilder();
builder.build(url);
pattern = builder.getPattern();
params = builder.getParamList();
if (keys.contains(generateKey()))
throw new ConfigException(
"duplicate resource exception ,pls check the path:["
+ url + "?" + this.verb + "]");
keys.add(generateKey());
this.handler = handler;
}

List<Class<?>> resourceTypes = Scanner.scanRestfulClass(servletContext);

resourceTypes 为空。。。。NND什么情况?

findWebInfURL(servletContext,"/WEB-INF/classes");
为空,/WEB-INF/classes没文件???

public static URL findWebInfClasses(ServletContext servletContext) {
return findWebInfURL(servletContext,"/WEB-INF/classes");
}


/**
* 鍦�/WEB-INF涓嬪鎵綰RL
* @param servletContext
* @param path
* @return
*/
public static URL findWebInfURL(ServletContext servletContext, String path) {
String realPath = servletContext.getRealPath(path);
if (realPath == null) return null;
File fp = new File(realPath);
if (fp.exists() == false) return null;
try {
return fp.toURI().toURL();
} catch (MalformedURLException e) {
throw new RuntimeException(e);
}
}
[该贴被tecentIDE26FC于2015-03-05 11:38修改过]

结贴:的确是/WEB-INF/classes没问编译文件的原因
将eclipse的Default output folder设置为/WEB-INF/classes就O了。