한글 오류 수정
This commit is contained in:
+29
-40
@@ -404,7 +404,7 @@ public class LayoutSyncController extends OnlBaseAnnotationController implements
|
|||||||
String resultS = null;
|
String resultS = null;
|
||||||
ServletInputStream sis = null;
|
ServletInputStream sis = null;
|
||||||
|
|
||||||
HashMap<String, String> param = new HashMap<String, String>();
|
HashMap<String, String> param = new HashMap<>();
|
||||||
String recvTime = DateUtil.getDateTime("yyyyMMddHHmmssSS").substring(0, 16);
|
String recvTime = DateUtil.getDateTime("yyyyMMddHHmmssSS").substring(0, 16);
|
||||||
|
|
||||||
// 초기화
|
// 초기화
|
||||||
@@ -431,43 +431,33 @@ public class LayoutSyncController extends OnlBaseAnnotationController implements
|
|||||||
byte[] arg = new byte[request.getContentLength()];
|
byte[] arg = new byte[request.getContentLength()];
|
||||||
int resultSet = 0;
|
int resultSet = 0;
|
||||||
int total = 0;
|
int total = 0;
|
||||||
try {
|
|
||||||
resultSet = sis.readLine(arg, 0, arg.length);
|
|
||||||
while(resultSet != -1) {
|
|
||||||
total += resultSet;
|
|
||||||
resultSet = sis.readLine(arg, total, 1024);
|
|
||||||
}
|
|
||||||
|
|
||||||
// ===== 인코딩 확인 로그 시작 =====
|
String xmlContent = null;
|
||||||
logger.info("========== 인코딩 디버깅 정보 ==========");
|
try {
|
||||||
logger.info("request.getCharacterEncoding(): " + request.getCharacterEncoding());
|
resultSet = sis.readLine(arg, 0, arg.length);
|
||||||
logger.info("request.getContentType(): " + request.getContentType());
|
while (resultSet != -1) {
|
||||||
logger.info("Content Length: " + arg.length + " bytes");
|
total += resultSet;
|
||||||
|
resultSet = sis.readLine(arg, total, 1024);
|
||||||
|
}
|
||||||
|
|
||||||
// 다양한 인코딩으로 읽어보기
|
xmlContent = new String(arg, "EUC-KR");
|
||||||
String asDefaultEncoding = new String(arg);
|
// ===== 인코딩 확인 로그 시작 =====
|
||||||
String asUtf8 = new String(arg, "UTF-8");
|
logger.info("========== 인코딩 디버깅 정보 ==========");
|
||||||
String asEucKr = new String(arg, "EUC-KR");
|
// 다양한 인코딩으로 읽어보기
|
||||||
|
logger.info("request.getCharacterEncoding(): {}", request.getCharacterEncoding());
|
||||||
|
logger.info("request.getContentType(): {}", request.getContentType());
|
||||||
|
logger.info("Content Length: {} bytes", arg.length);
|
||||||
|
logger.info("EUC-KR 전체 내용:\n{}", xmlContent);
|
||||||
|
logger.info("========================================");
|
||||||
|
// ===== 인코딩 확인 로그 끝 =====
|
||||||
|
param.put("recvData", xmlContent);
|
||||||
|
} catch (Exception e) {
|
||||||
|
logger.error("MessageSync.err - don't read the XML File", e);
|
||||||
|
param.put("recvData", "");
|
||||||
|
}
|
||||||
|
|
||||||
logger.info("Default Encoding 전체 내용:\n" + asDefaultEncoding);
|
// byte[]로부터 XML 파싱 - EUC-KR로 읽기
|
||||||
logger.info("UTF-8 전체 내용:\n" + asUtf8);
|
Document doc = builder.build(new StringReader(xmlContent));
|
||||||
logger.info("EUC-KR 전체 내용:\n" + asEucKr);
|
|
||||||
logger.info("========================================");
|
|
||||||
// ===== 인코딩 확인 로그 끝 =====
|
|
||||||
|
|
||||||
param.put("recvData", new String(arg, "EUC-KR"));
|
|
||||||
} catch(Exception e) {
|
|
||||||
logger.error("MessageSync.err - don't read the XML File - " + new String(arg, "EUC-KR"), e);
|
|
||||||
param.put("recvData", "");
|
|
||||||
}
|
|
||||||
|
|
||||||
// byte[]로부터 XML 파싱 (BOM 제거) - EUC-KR로 읽기
|
|
||||||
String xmlContent = new String(arg, "EUC-KR").trim();
|
|
||||||
// BOM 제거 (UTF-8 BOM: EF BB BF)
|
|
||||||
if (xmlContent.startsWith("\uFEFF")) {
|
|
||||||
xmlContent = xmlContent.substring(1);
|
|
||||||
}
|
|
||||||
Document doc = builder.build(new ByteArrayInputStream(xmlContent.getBytes("EUC-KR")));
|
|
||||||
|
|
||||||
param.put("logPrcssSeqno", UUIDGenerator.getUUID());
|
param.put("logPrcssSeqno", UUIDGenerator.getUUID());
|
||||||
// xml 1.1
|
// xml 1.1
|
||||||
@@ -485,9 +475,9 @@ public class LayoutSyncController extends OnlBaseAnnotationController implements
|
|||||||
param.put("recvAmndHMS", recvTime);
|
param.put("recvAmndHMS", recvTime);
|
||||||
|
|
||||||
logger.info(layoutName + " command - [" + command +"]");
|
logger.info(layoutName + " command - [" + command +"]");
|
||||||
HashMap<String, Object> returnMap = new HashMap<String,Object>();
|
HashMap<String, Object> returnMap = new HashMap<>();
|
||||||
if( command.equals("delete") ) {
|
if( command.equals("delete") ) {
|
||||||
HashMap<String,Object> vo = new HashMap<String,Object>();
|
HashMap<String,Object> vo = new HashMap<>();
|
||||||
vo.put("loutName",layoutName);
|
vo.put("loutName",layoutName);
|
||||||
|
|
||||||
service.deleteLayout(vo);
|
service.deleteLayout(vo);
|
||||||
@@ -513,10 +503,10 @@ public class LayoutSyncController extends OnlBaseAnnotationController implements
|
|||||||
// }
|
// }
|
||||||
|
|
||||||
String layout = body.getChild("data").getText();
|
String layout = body.getChild("data").getText();
|
||||||
logger.info(layoutName + " recv Data - [" + layout + "]");
|
logger.info("{} recv Data - [{}]]", layoutName, layout);
|
||||||
param.put("recvData", layout);
|
param.put("recvData", layout);
|
||||||
|
|
||||||
Document doc2 = builder.build(new ByteArrayInputStream(layout.getBytes()));
|
Document doc2 = builder.build(new StringReader(layout));
|
||||||
|
|
||||||
HashMap<String,Object> vo = new HashMap<String,Object>();
|
HashMap<String,Object> vo = new HashMap<String,Object>();
|
||||||
|
|
||||||
@@ -601,7 +591,6 @@ public class LayoutSyncController extends OnlBaseAnnotationController implements
|
|||||||
|
|
||||||
} catch( Exception e ) {
|
} catch( Exception e ) {
|
||||||
logger.error("",e);
|
logger.error("",e);
|
||||||
logger.error("",e.getStackTrace()[0]);
|
|
||||||
try {
|
try {
|
||||||
if( results != null ) {
|
if( results != null ) {
|
||||||
if (e instanceof UseSystemException) {
|
if (e instanceof UseSystemException) {
|
||||||
|
|||||||
Reference in New Issue
Block a user