}
@Get("method")
public Object method(Invocation pinv) {
InvocationBean inv = (InvocationBean) pinv;
RequestPath curpath = inv.getRequestPath();
String testUri = inv.getRequest().getQueryString(); // queryString as uri
if (testUri == null || testUri.length() == 0) {
return "@e.g. <a href='/rose-info/method?get=/rose-info/tree'>/rose-info/method?get=/rose-info/tree</a>";
}
ReqMethod testMethod = curpath.getMethod();
if (testUri.indexOf('=') > 0) {
int index = testUri.indexOf('=');
testMethod = ReqMethod.parse(testUri.substring(0, index));
testUri = testUri.substring(index + 1);
}
if (!testUri.startsWith(curpath.getCtxpath())) {
return "@wrong uri:" + testUri;
}
MappingNode tree = inv.getRose().getMappingTree();
RequestPath testPath = new RequestPath(//
testMethod, testUri, curpath.getCtxpath(), curpath.getDispatcher());
//
ArrayList<MatchResult> matchResults = tree.match(testPath);
if (matchResults == null) {
// not rose uri