java simple mvc support restful and annotation ,some kind of params will be post in method.
具体例子请查看DEMO。非常简单的MVC。spring mvc精简版。
/ demo 不带参数
Title:
URL:http://127.0.0.1:8080/demo/demo/demo.html
URL:http://127.0.0.1:8080/demo/demo/demo3/demo2.html
URL:http://127.0.0.1:8080/demo/demo/demo1.html?demo=3
URL:http://127.0.0.1:8080/demo/demo/demo3.html?demo=3
URL: http://127.0.0.1:8080/demo/demo/demo4/sa/demo6.html> @param demo4 @throws Exception */ @Route(value=”/demo4/sa/{demo4}.html”,cls=demoInterceptot.class) @MethodType(type=mType.get) public void demo4(@RouteParam(“demo4”) String demo4) throws Exception{ HttpServletResponse response=MvcPageContextUtil.getResponse(); MvcPageUtil.resultJsonToString(response, demo4); }
/**
参数第种方式
URL:http://127.0.0.1:8080/demo/demo/demo7.html?demo=3&demo1=4
@param demo
@throws Exception
*/
@Route(value=”/demo7.html”)
@MethodType(type=mType.get)
public void demo7(@QueryParam(“demo”) JSONObject demo) throws Exception{
HttpServletResponse response=MvcPageContextUtil.getResponse();
MvcPageUtil.resultJsonToString(response, demo.toJSONString());
}