package com.mingsoft.servlet.regex;

import java.io.IOException;
import java.io.PrintWriter;

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

import com.mingsoft.biz.IArticleTypeBiz;
import com.mingsoft.biz.impl.ArticleTypeBizImpl;
import com.mingsoft.constant.RegexConstant;
import com.mingsoft.entity.ArticleTypeEntity;
import com.mingsoft.servlet.ViewServlet;
/**
 * 查看替换标签后的列表模版
 * @author 成卫雄
 * QQ:330216230
 * 技术支持：景德镇铭飞科技
 * 官网：www.ming-soft.com
 */
@SuppressWarnings("serial")
public class ListView extends ViewServlet{

	@Override
	protected void doGet(HttpServletRequest request,
			HttpServletResponse response) throws ServletException, IOException {
		// TODO Auto-generated method stub
		super.doPost(request, response);
		//接受链接地址中的栏目ID
		String articleTypeId = request.getParameter(RegexConstant.REGEX_ARETICLETYPE_URL_B);
		int articleTypeIdInt = 0;
		String  listHtml = RegexConstant.VIEW_NOT_HTML;
		if(articleTypeId != null){
			articleTypeIdInt = Integer.parseInt(articleTypeId);
			IArticleTypeBiz articleTypeBiz =  new ArticleTypeBizImpl();
			ArticleTypeEntity articleType = articleTypeBiz.articleTypeSearchWithId(articleTypeIdInt);
			if(articleType != null){
				listHtml = articleType.getArticleTypeListTem();
			}
		}
		htmlComent = getHtml(listHtml,0,articleTypeIdInt);
		//将替换好内容的HTML输出到页面
		PrintWriter out = response.getWriter();
		out.print(htmlComent);
		out.close();
	}
}
