📄 viewarticlecontroller.java
字号:
/*
* Created on 2004-10-4
* Author: Xuefeng, Copyright (C) 2004, Xuefeng.
*/
package org.crystalblog.web;
import java.util.*;
import javax.servlet.http.*;
import org.crystalblog.domain.*;
import org.crystalblog.logic.Facade;
import org.springframework.web.servlet.ModelAndView;
import org.springframework.web.servlet.mvc.Controller;
/**
* To view the content of the article.
*
* @author Xuefeng
*/
public class ViewArticleController implements Controller {
private SkinManager skin;
private Facade facade;
public void setSkinManager(SkinManager skin) { this.skin = skin; }
public void setFacade(Facade facade) { this.facade = facade; }
public ModelAndView handleRequest(HttpServletRequest request, HttpServletResponse response) throws Exception {
int articleId = Integer.parseInt(request.getParameter("articleId"));
Article article = facade.getArticle(articleId);
int accountId = article.getAccountId();
Account account = facade.getAccount(accountId);
List categories = facade.getCategories(accountId);
List links = facade.getAllLinks(accountId);
List feedbacks = facade.getFeedbacks(articleId);
Map map = new HashMap();
map.put("article", article);
map.put("feedbacks", feedbacks);
map.put("account", account);
map.put("categories", categories);
map.put("links", links);
return new ModelAndView(skin.getSkin(account.getSkinId()) + "article.html", map);
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -