Package cn.webwheel.results

Examples of cn.webwheel.results.ErrorResult


    @Action(value = "?id=$1&tag=$3", rest = "/user/([^/]+)(/(.+)?)?")
    public Object html() throws SQLException {
        user = qr.query("select * from User where id=?", new BeanHandler<User>(User.class), id);
        if (user == null) {
            return new ErrorResult(404);
        }
        if ((tag = tag.trim()).isEmpty()) tag = null;
        if (tag == null) {
            articles = qr.query("select * from Article where authorId=? order by postDate desc limit ? offset ?", new BeanListHandler<Article>(Article.class),
                    user.id, pageSize, (pg - 1) * pageSize);
 
View Full Code Here


    @Action
    public Object html(int id, int pg) throws SQLException {
        topic = topicService.findTopic(id);
        if (topic == null) {
            return new ErrorResult(404);
        }
        author = userService.findUser(topic.authorId);
        replies = topicService.listReply(topic.id, pg, 30);
        for (Reply reply : replies) {
            reply.author = userService.findUser(reply.authorId);
View Full Code Here

            return new RedirectResult("/");
        }
        if (article != null) {
            article = qr.query("select * from Article where id=?", new BeanHandler<Article>(Article.class), this.article.id);
            if (article == null) {
                return new ErrorResult(404);
            }
        } else {
            article = new Article();
        }
        return new TemplateResult(this);
View Full Code Here

    @Action(value = "?article.id=$1&pg=$3", rest = "/article/(\\d+)(/(\\d+))?")
    public Object html() throws SQLException {
        article = qr.query("select * from Article where id=?", new BeanHandler<Article>(Article.class), article.id);
        if (article == null) {
            return new ErrorResult(404);
        }
        qr.update("update Article set view=view+1 where id=?", article.id);
        user = qr.query("select * from User where id=?", new BeanHandler<User>(User.class), article.authorId);
        if (user == null) {
            return new ErrorResult(404);
        }
        String[] tags = article.getTagList();
        if (tags.length > 0) {
            tag = tags[0];
        }
View Full Code Here

    @Action
    public Object html() throws SQLException {
        board = boardService.findBoard(id);
        if (board == null) {
            return new ErrorResult(404);
        }
        topics = topicService.listBoardTopic(id, pg, 30);
        return new TemplateResult(this);
    }
View Full Code Here

        if (id == 0) {
            category = new BoardCategory();
        } else {
            category = boardService.findCategory(id);
            if (category == null) {
                return new ErrorResult(404);
            }
        }
        return new TemplateResult(this);
    }
View Full Code Here

        if (id == null) {
            user = new User();
        } else {
            user = userService.findUser(id);
            if (user == null) {
                return new ErrorResult(404);
            }
        }
        return new TemplateResult(this);
    }
View Full Code Here

        if (id == 0 && boardCategoryId != 0) {
            board = new Board();
            board.boardCategoryId = boardCategoryId;
            board.category = boardService.findCategory(boardCategoryId);
            if (board.category == null) {
                return new ErrorResult(404);
            }
        } else {
            board = boardService.findBoard(id);
            if (board == null) {
                return new ErrorResult(404);
            }
        }
        return new TemplateResult(this);
    }
View Full Code Here

TOP

Related Classes of cn.webwheel.results.ErrorResult

Copyright © 2018 www.massapicom. 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.