Examples of AjaxView


Examples of org.nutz.web.ajax.AjaxView

    Auth auth = method.getAnnotation(Auth.class);
    if (auth == null) //没有@Auth,恩,无需过滤
      return null; //返回null,就是继续下一个ActionFilter
    User me = (User) actionContext.getRequest().getSession().getAttribute("me");
    if (me == null)
      return new ViewWrapper(new AjaxView(), Ajax.fail().setData("Not login yet!"));
    if ("anonymous".equals(me.getProvider())) //默认用户? 啥授权都不允许
      return new ViewWrapper(new AjaxView(), Ajax.fail().setData("anonymous can't do this!"));
    if ("root".equals(me.getProvider())) {
      if (log.isInfoEnabled())
        log.info("Access as root , pass");
      return null;
    }
View Full Code Here

Examples of org.nutz.web.ajax.AjaxView

    String uri = req.getRequestURI();
    if (uri.endsWith(".json")) {
      if (obj instanceof Map && ((Map)obj).containsKey("error")) {
        obj = Ajax.fail().setData(obj);
      }
      new AjaxView().render(req, resp, obj);
    }
    else if (uri.endsWith(".jsonp"))
      new JsonpView("jsoncallback").render(req, resp, obj);
    else if (uri.endsWith(".rss"))
      new RssView().render(req, resp, obj);
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.