Package com.dream.controller.article

Source Code of com.dream.controller.article.ArticleViewController

package com.dream.controller.article;

import com.dream.dto.article.ArticleDTO;
import com.dream.service.ArticleService;
import org.springframework.web.bind.ServletRequestUtils;
import org.springframework.web.servlet.ModelAndView;
import org.springframework.web.servlet.mvc.AbstractController;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

/**
* Created by IntelliJ IDEA.
* User: Gang Zhong
* Date: 13-3-5
* Time: 下午3:58
*/
public class ArticleViewController extends AbstractController {
    private ArticleService articleService;

    @Override
    protected ModelAndView handleRequestInternal(HttpServletRequest request, HttpServletResponse response) throws Exception {
        String articleGuid = ServletRequestUtils.getRequiredStringParameter(request, "guid");
        ArticleDTO articleDTO = articleService.loadArticleByGuid(articleGuid);
        return new ModelAndView("article/articleView", "articleDTO", articleDTO);
    }

    public void setArticleService(ArticleService articleService) {
        this.articleService = articleService;
    }
}
TOP

Related Classes of com.dream.controller.article.ArticleViewController

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.