package jeus_jspwork._moniter._failHandler;

import javax.servlet.*;
import javax.servlet.http.*;
import javax.servlet.jsp.*;
import java.util.*;
import org.kldp.ebmsh.moniter.failHandler.FailMessageManager;
import org.kldp.ebmsh.moniter.failHandler.BiFailMessageInfo;

public final class _500_biFailHandlerView_5fjsp extends jeus.servlet.jsp2.runtime.HttpJspBase
    implements jeus.servlet.jsp2.runtime.JspSourceDependent {

  private static java.util.Vector _jspx_dependants;

  public java.util.List getDependants() {
    return _jspx_dependants;
  }

  public void _jspService(HttpServletRequest request, HttpServletResponse response)
        throws java.io.IOException, ServletException {

    JspFactory _jspxFactory = null;
    PageContext pageContext = null;
    HttpSession session = null;
    ServletContext application = null;
    ServletConfig config = null;
    JspWriter out = null;
    Object page = this;
    JspWriter _jspx_out = null;
    PageContext _jspx_page_context = null;


    try {
      _jspxFactory = JspFactory.getDefaultFactory();
      response.setContentType("text/html; charset=euc-kr");
      pageContext = _jspxFactory.getPageContext(this, request, response,
      			null, true, 8192, true);
      _jspx_page_context = pageContext;
      application = pageContext.getServletContext();
      config = pageContext.getServletConfig();
      session = pageContext.getSession();
      out = pageContext.getOut();
      _jspx_out = out;

      out.write("\r\n");
      out.write("\r\n");
      out.write("\r\n");
      out.write("\r\n");
      out.write("\r\n");

	// 실패 메시지 정보가 세션에 남아 있는 경우 삭제한다.
	session.removeAttribute("biFailMessageInfoList");
	
	FailMessageManager failMessageManager = new FailMessageManager();
		
	List<BiFailMessageInfo> biFailMessageInfoList = failMessageManager.getBusinessLogicFailMessage();
	
	// 실패 메시지 정보를 세션에 저장합니다.
	session.setAttribute("biFailMessageInfoList", biFailMessageInfoList);

      out.write("\r\n");
      out.write("\r\n");
      out.write("<table width=\"100%\" border=\"0\" cellpadding=\"0\" cellspacing=\"1\"\r\n");
      out.write("\tbgcolor=\"#CDDCED\">\r\n");
      out.write("\t<tr>\r\n");
      out.write("\t\t<td\r\n");
      out.write("\t\t\tstyle=\"PADDING-LEFT: 10px; PADDING-RIGHT: 20px; PADDING-TOP: 5px; PADDING-BOTTOM: 5px;\"\r\n");
      out.write("\t\t\tbgcolor=\"#FFFFFF\">\r\n");
      out.write("\t\t\t<table width=\"100%\" border=\"0\" align=\"center\" cellpadding=\"0\"\r\n");
      out.write("\t\t\t\tcellspacing=\"0\">\r\n");
      out.write("\t\t\t\t<tr>\r\n");
      out.write("\t\t\t\t\t<td width=\"15\">\r\n");
      out.write("\t\t\t\t\t\t<img src=\"");
      out.print(request.getContextPath());
      out.write("/image/search/icon_arrow.gif\" width=\"11\" height=\"11\">\r\n");
      out.write("\t\t\t\t\t</td>\r\n");
      out.write("\t\t\t\t\t<td>\r\n");
      out.write("\t\t\t\t\t\t<span class=\"style2\">Business logic 에러 메시지</span>\r\n");
      out.write("\t\t\t\t\t</td>\r\n");
      out.write("\t\t\t\t</tr>\r\n");
      out.write("\t\t\t</table>\r\n");
      out.write("\t\t</td>\r\n");
      out.write("\t</tr>\r\n");
      out.write("</table>\r\n");
      out.write("\r\n");
      out.write("<br>\r\n");
      out.write("<table width=\"100%\" height=\"39\" border=\"0\" cellpadding=\"0\"\r\n");
      out.write("\tcellspacing=\"0\">\r\n");
      out.write("\t<tr>\r\n");
      out.write("\t\t<td background=\"sub/search_bg.gif\"\r\n");
      out.write("\t\t\tstyle=\"PADDING-RIGHT: 10px; PADDING-LEFT: 10px;\">\r\n");
      out.write("\t\t\t총 \r\n");
      out.write("\t\t\t<span class=\"style1\"> ");
      out.print(biFailMessageInfoList.size());
      out.write(" </span>건의 에러 메시지가 존재 합니다.\r\n");
      out.write("\t\t</td>\r\n");
      out.write("\t</tr>\r\n");
      out.write("</table>\r\n");
      out.write("\r\n");
      out.write("<br>\r\n");
      out.write("<table width=\"100%\" border=\"0\" align=\"center\" cellpadding=\"0\"\r\n");
      out.write("\tcellspacing=\"0\">\r\n");
      out.write("\t<tbody>\r\n");
      out.write("\t\t<tr>\r\n");
      out.write("\t\t\t<td width=\"60%\" height=\"30\" align=\"center\"\r\n");
      out.write("\t\t\t\tbackground=\"");
      out.print(request.getContextPath());
      out.write("/image/search/td_bg.gif\">\r\n");
      out.write("\t\t\t\t메시지 아이디\r\n");
      out.write("\t\t\t</td>\r\n");
      out.write("\t\t\t<td width=\"40%\" align=\"center\"\r\n");
      out.write("\t\t\t\tbackground=\"");
      out.print(request.getContextPath());
      out.write("/image/search/td_bg.gif\">\r\n");
      out.write("\t\t\t\t상태\r\n");
      out.write("\t\t\t</td>\r\n");
      out.write("\t\t</tr>\r\n");
      out.write("\r\n");
      out.write("\t\t");

			if ( biFailMessageInfoList.isEmpty() ) {
		
      out.write("\r\n");
      out.write("\t\t\t<tr>\r\n");
      out.write("\t\t\t\t<td colspan=\"5\" style=\"text-align:center\">\r\n");
      out.write("\t\t\t\t\t실패 메시지가 없습니다.\r\n");
      out.write("\t\t\t\t</td>\r\n");
      out.write("\t\t\t</tr>\r\n");
      out.write("\t\r\n");
      out.write("\t\t\t<tr>\r\n");
      out.write("\t\t\t\t<td colspan=\"5\" align=\"center\" bgcolor=\"#f0f0f0\"></td>\r\n");
      out.write("\t\t\t</tr>\r\n");
      out.write("\t\t");

			} 
			else {
				for(int i = 0; i < biFailMessageInfoList.size(); i++) {
					BiFailMessageInfo faultMessageInfo = biFailMessageInfoList.get(i);
		
      out.write("\r\n");
      out.write("\t\t\t\t\t<tr>\r\n");
      out.write("\t\t\t\t\t\t<td width=\"60%\" height=\"20\" align=\"center\">\r\n");
      out.write("\t\t\t\t\t\t\t");
      out.print( faultMessageInfo.getMessageId()  );
      out.write("\r\n");
      out.write("\t\t\t\t\t\t</td>\r\n");
      out.write("\t\t\t\t\t\t\r\n");
      out.write("\t\t\t\t\t\t<td width=\"40%\" align=\"center\">\r\n");
      out.write("\t\t\t\t\t\t\t");
      out.print( faultMessageInfo.getStatus() );
      out.write("\r\n");
      out.write("\t\t\t\t\t\t</td>\r\n");
      out.write("\t\t\t\t\t</tr>\r\n");
      out.write("\t\t\t\r\n");
      out.write("\t\t\t\t\t<tr>\r\n");
      out.write("\t\t\t\t\t\t<td colspan=\"5\" align=\"center\" bgcolor=\"#f0f0f0\"></td>\r\n");
      out.write("\t\t\t\t\t</tr>\r\n");
      out.write("\t\t");

				}
			}
		
      out.write("\r\n");
      out.write("\t</tbody>\r\n");
      out.write("</table>\r\n");
      out.write("\r\n");
      out.write("<table width=\"100%\" height=\"45\" border=\"0\" cellpadding=\"0\"\r\n");
      out.write("\tcellspacing=\"1\">\r\n");
      out.write("\t<tr align=\"center\">\r\n");
      out.write("\t\t<td>\r\n");
      out.write("\t\t\t<form action=\"biFailHandlerProcess.jsp\" style=\"margin:0px;padding:0px;\"\r\n");
      out.write("\t\t\t\tname=\"failHandlerForm\">\r\n");
      out.write("\t\t\t\t<span align=\"right\" style=\"vertical-align:middle; margin-left:10px\">\r\n");
      out.write("\t\t\t\t\t<input type=\"submit\" value=\"재처리 요청\"> </span>\r\n");
      out.write("\t\t\t</form>\r\n");
      out.write("\t\t</td>\r\n");
      out.write("\t</tr>\r\n");
      out.write("</table>\r\n");
    } catch (Throwable t) {
      if (!(t instanceof SkipPageException)){
        out = _jspx_out;
        if (out != null && out.getBufferSize() != 0)
          out.clearBuffer();
        if (_jspx_page_context != null) _jspx_page_context.handlePageException(t);
      }
    } finally {
      if (_jspxFactory != null) _jspxFactory.releasePageContext(_jspx_page_context);
    }
  }
}
