<%-- <%@ page import="java.io.*, java.util.*"%>
<%@ page language="java" contentType="text/html;charset=utf-8"%>
<%@ page import="com.kbstar.eai.common.kbmessage.*,com.kbstar.eai.common.kbmessage.parser.*"%>
<%
	String action = request.getParameter("Convert");
	String kbmessagetext = "";
	String fixeddata = "";
	String xmldata = "";
	String errorMsg = "";
	
	if("Convert".equals(action)) {
		try {
			kbmessagetext = request.getParameter("kbmessagetext");
			//KBMessage kbMsg = KBMessageUtil.convert(kbmessagetext.getBytes(), false);
			KBMessageParser parser = KBMessageParserFactory.createPaserFactory(KBMessageParserType.ASC.toString());
			KBMessage kbMsg = parser.convert(kbmessagetext.getBytes());
			fixeddata = kbMsg.toString();
			xmldata = kbMsg.toXMLString();
		}
		catch(Exception e) {
			errorMsg = e.getMessage();
		}
	}
%>
<html>
<head>
        <title>
            KBMessage Util
        </title>
        <script>
        function doAction() {
            document.frm.submit();
        }
        </script>
    </head>
    <body>
        <p style="font-size:12pt;">
        <b>Message Parser</b> <br><br>
        </p>
<form name="form" action="" method="post">
<table border='0' width="800" >
        <tr>
        <td align='left'>
            <input type="submit" name="Convert" value="Convert">
        </td>
        </tr>
<% if(errorMsg != null && errorMsg.length() > 0) { %>
        <tr>
        <td align='left'><pre><%= errorMsg %></pre></td>
        </tr>
<% } %>
        </table>
<table width="800" border=0 bgcolor='black' cellpadding="1" cellspacing="1">
<tr bgcolor='white'>
    <td align='left' width='180' bgcolor="#ccccff">&nbsp;KBMessage 전문</td>
    <td align='left'>&nbsp;<textarea name="kbmessagetext" cols="80" rows="10"><%= kbmessagetext %></textarea></td>
</tr>
<tr bgcolor='white'>
    <td align='left' width='180' bgcolor="#ccccff">&nbsp;전문파싱</td>
    <td align='left'>&nbsp;<textarea name="fixeddata" cols="80" rows="10"><%= fixeddata %></textarea></td>
</tr>
<tr bgcolor='white'>
    <td align='left' width='180' bgcolor="#ccccff">&nbsp;XML 전문</td>
    <td align='left'>&nbsp;<textarea name="xmldata" cols="80" rows="10"><%= xmldata %></textarea></td>
</tr>
</table>
</form>
</html> --%>