NutzCN Logo
问答 fail不能正常跳转
发布于 2446天前 作者 lambert 1607 次浏览 复制 上一个帖子 下一个帖子
标签:

大神好,我想在系统中抛运行期异常,然后内部跳转请求,可是不知道为什么,一直不动,不知道是我那里写的有问题吗?

@At("/productList")
    @Ok("beetl:/custom/customize.html")
    @Fail(">>:/custom/product")
    public List<CompanyCustomize> productList(HttpServletRequest req, @Param("pageNum") int pageNumber,
                                              @Param("by") int by, @Param("on") int on, @Param("dis") int dis
    ){
        try{
            //验证登录
            MAccount mAccount = isLogin(req);
            if (isEmpty(mAccount)) {
                return null;
            }
            List<CompanyCustomize> coms = mCompanyProductService.getCustomizes(mAccount);

            if(coms.isEmpty()) {
                throw new RuntimeException("转向");
            }
            return coms;
        }catch(Exception e){
            return null;
        }
    }
4 回复

500等fail才会走fail,你都try了是正常输出当然是OK

二位神,我改了一下,明白了,弄懂了,谢谢二位哈

添加回复
请先登陆
回到顶部