2024-09-05 18:15 코드 관리

This commit is contained in:
myname 2024-09-05 18:15:43 +09:00
parent d3664c4b64
commit 5b14cfff36
4 changed files with 501 additions and 343 deletions

View File

@ -1,108 +1,120 @@
package seed.com.user.code; package seed.com.user.code;
import java.util.Map; import java.util.Map;
import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpSession; import javax.servlet.http.HttpSession;
import org.apache.ibatis.logging.Log; import org.apache.ibatis.logging.Log;
import org.apache.ibatis.logging.LogFactory; import org.apache.ibatis.logging.LogFactory;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller; import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.PathVariable; import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.servlet.ModelAndView; import org.springframework.web.servlet.ModelAndView;
import egovframework.rte.psl.dataaccess.util.EgovMap; import egovframework.rte.psl.dataaccess.util.EgovMap;
import seed.com.gtm.service.BaseService; import seed.com.gtm.service.BaseService;
import seed.com.gtm.util.JSONView; import seed.com.gtm.util.JSONView;
import seed.com.gtm.util.JSPUtil; import seed.com.gtm.util.JSPUtil;
@Controller @Controller
/*@RequestMapping("/gtm/case")*/ /*@RequestMapping("/gtm/case")*/
public class CodeController { public class CodeController {
protected Log log = LogFactory.getLog(this.getClass()); protected Log log = LogFactory.getLog(this.getClass());
//CodeService, BaseService는 관리자단에서 공통으로 가져다 쓰고있음 //CodeService, BaseService는 관리자단에서 공통으로 가져다 쓰고있음
@Autowired @Autowired
private BaseService bservice; private BaseService bservice;
public void setSessionMessageRemove(HttpSession session){ public void setSessionMessageRemove(HttpSession session){
session.removeAttribute("sSiteIdx"); session.removeAttribute("sSiteIdx");
session.removeAttribute("url"); session.removeAttribute("url");
session.removeAttribute("message"); session.removeAttribute("message");
session.removeAttribute("opener"); session.removeAttribute("opener");
session.removeAttribute("append"); session.removeAttribute("append");
session.removeAttribute("self"); session.removeAttribute("self");
} }
@RequestMapping(value = "/user/case/{pageFolder}/{pageName}/{pageAction}.do") @RequestMapping(value = "/user/case/{pageFolder}/{pageName}/{pageAction}.do")
public ModelAndView getManagerPage(HttpServletRequest request, public ModelAndView getManagerPage(HttpServletRequest request,
HttpSession session, Map<String, Object> map, HttpSession session, Map<String, Object> map,
@PathVariable(value="pageFolder") String pageFolder, @PathVariable(value="pageFolder") String pageFolder,
@PathVariable(value="pageName") String pageName, @PathVariable(value="pageName") String pageName,
@PathVariable(value="pageAction") String pageAction @PathVariable(value="pageAction") String pageAction
) throws Exception { ) throws Exception {
EgovMap params; EgovMap params;
request.setCharacterEncoding("UTF-8"); request.setCharacterEncoding("UTF-8");
ModelAndView mav = new ModelAndView(); ModelAndView mav = new ModelAndView();
ModelAndView mavjson = new ModelAndView(new JSONView()); ModelAndView mavjson = new ModelAndView(new JSONView());
params = JSPUtil.makeRequestParams(request, session, true); params = JSPUtil.makeRequestParams(request, session, true);
//시큐어코딩 관련 파라미터는 삭제 //시큐어코딩 관련 파라미터는 삭제
params.remove("SpringSecurityFiltersecurityinterceptorFilterapplied"); params.remove("SpringSecurityFiltersecurityinterceptorFilterapplied");
params.remove("SpringSecuritySessionMgmtFilterApplied"); params.remove("SpringSecuritySessionMgmtFilterApplied");
params.remove("springSecurityContext"); params.remove("springSecurityContext");
params.remove("SpringSecurityScpfApplied"); params.remove("SpringSecurityScpfApplied");
params.remove("springSecuritySavedRequest"); params.remove("springSecuritySavedRequest");
String type = ""; String type = "";
if(!"".equals((String) params.get("type")) && (String) params.get("type") != null){ if(!"".equals((String) params.get("type")) && (String) params.get("type") != null){
type = (String) params.get("type"); type = (String) params.get("type");
}else{ }else{
//type이 없을 경우 default 리스트 출력 //type이 없을 경우 default 리스트 출력
type = "L"; type = "L";
} }
log.warn(">>>>>>type<<<<<<"+type); log.warn(">>>>>>type<<<<<<"+type);
params.put("sql", pageFolder+pageAction); params.put("sql", pageFolder+pageAction);
log.warn(">>>>>>>>params1<<<<<<<<<"+params); log.warn(">>>>>>>>params1<<<<<<<<<"+params);
if("L".equals(type)){ if("L".equals(type)){
//mav.addObject("data", bservice.list(params)); //mav.addObject("data", bservice.list(params));
params.put("data", JSPUtil.fixNull(bservice.list(params))); params.put("data", JSPUtil.fixNull(bservice.list(params)));
}else if("S".equals(type)){ }else if("S".equals(type)){
//mav.addObject("data", bservice.select(params)); //mav.addObject("data", bservice.select(params));
params.put("data", JSPUtil.fixNull(bservice.select(params))); params.put("data", JSPUtil.fixNull(bservice.select(params)));
}else if("I".equals(type)){ }else if("I".equals(type)){
params.put("data", JSPUtil.fixNull(bservice.insert(params))); params.put("data", JSPUtil.fixNull(bservice.insert(params)));
}else if("U".equals(type)){ }else if("U".equals(type)){
//mav.addObject("data", bservice.update(params)); //mav.addObject("data", bservice.update(params));
params.put("data", JSPUtil.fixNull(bservice.update(params)).toString()); params.put("data", JSPUtil.fixNull(bservice.update(params)).toString());
}else if("D".equals(type)){ }else if("D".equals(type)){
//mav.addObject("data", bservice.delete(params)); //mav.addObject("data", bservice.delete(params));
params.put("data", JSPUtil.fixNull(bservice.delete(params)).toString()); params.put("data", JSPUtil.fixNull(bservice.delete(params)).toString());
} }
log.warn(">>>>>>>>params2<<<<<<<<<"+params); log.warn(">>>>>>>>params2<<<<<<<<<"+params);
if("ajax".equals(pageName)){ if("Exam".equals(pageFolder)
log.warn("===================[[ ajax! ]]================="); && "ajax".equals(pageName)
&& "BBsInfo".equals(pageAction)
){
params.remove("simpleCaptcha"); EgovMap params1 = new EgovMap();
mavjson.addAllObjects(params); params1.put("data", params.get("data"));
return mavjson;
}else{ mavjson.addAllObjects(params1);
mav.addAllObjects(params); //System.out.println(params);
return mav; return mavjson;
}
} }else if("ajax".equals(pageName)){
log.warn("===================[[ ajax! ]]=================");
}
params.remove("simpleCaptcha");
mavjson.addAllObjects(params);
//System.out.println(params);
return mavjson;
}else{
mav.addAllObjects(params);
return mav;
}
}
}

View File

@ -90,7 +90,7 @@
<script src="/js/jquery.form.js"></script> <script src="/js/jquery.form.js"></script>
<script src="/js/commonFileUtil.js"></script> <script src="/js/commonFileUtil.js"></script>
<script src="/js/common_XHR.js"></script> <script src="/js/common_XHR.js?3"></script>
<script src="/js/common.js"></script> <script src="/js/common.js"></script>
<script src="/js/DateTimePicker.js"></script> <script src="/js/DateTimePicker.js"></script>
<script src="/js/jquery.selectboxes.js"></script> <script src="/js/jquery.selectboxes.js"></script>

View File

@ -1,234 +1,239 @@
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%> <%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %> <%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@ taglib uri="http://www.springframework.org/tags/form" prefix="form"%> <%@ taglib uri="http://www.springframework.org/tags/form" prefix="form"%>
<!doctype html>
<html lang="ko"> <!doctype html>
<head> <html lang="ko">
<title>정보 관리</title> <head>
<link href='/css/space.css' rel='stylesheet' type='text/css'/> <title>정보 관리</title>
<link href='/css/seed.contents.css' rel='stylesheet' type='text/css'/> <link href='/css/space.css' rel='stylesheet' type='text/css'/>
<link href='/css/seed.mediaquery.css' rel='styleGsheet' type='text/css'/> <link href='/css/seed.contents.css' rel='stylesheet' type='text/css'/>
<link href='/site/ntcc/css/gtmCustom.css' rel='stylesheet' type='text/css'/> <link href='/css/seed.mediaquery.css' rel='styleGsheet' type='text/css'/>
<link href='/site/ntcc/css/gtmCustom.css' rel='stylesheet' type='text/css'/>
<script src="/editor/webnote.js"></script>
</head> <script src="/editor/webnote.js"></script>
<body>
<div class="page-title-wrap clear"> </head>
<div class="page-title-inner"> <body>
<h3 class="page-title">분쟁조정 사례(${menuName})</h3> <div class="page-title-wrap clear">
<div class="tooltipBox type01"> <div class="page-title-inner">
<button type="button" class="page-tip">페이지안내</button> <h3 class="page-title">분쟁조정 사례(${menuName})</h3>
<div class="tooltipText"> <div class="tooltipBox type01">
<p>분쟁조정 사례(${menuName})를 작성 할 수 있는 페이지 입니다.</p> <button type="button" class="page-tip">페이지안내</button>
</div> <div class="tooltipText">
</div> <p>분쟁조정 사례(${menuName})를 작성 할 수 있는 페이지 입니다.</p>
</div> </div>
</div> </div>
<form:form name="frm" id="frm" action="" method="post"> </div>
<input type="hidden" name="boardIdxx" id="boardIdxx" value=""> </div>
<input type="hidden" name="medBig" id="medBig" value=""> <form:form name="frm" id="frm" action="" method="post">
</form:form> <input type="hidden" name="boardIdxx" id="boardIdxx" value="">
<%-- <form:form name="writeFrm" id="writeFrm" action="${pageType}/${siteIdx}/${boardIdx}/write.do" method="post"> --%> <input type="hidden" name="medBig" id="medBig" value="">
<form:form name="writeFrm" id="writeFrm" action="/gtm/case/exam/${boardIdx}/write.do" method="post"> </form:form>
<%-- <form:form name="writeFrm" id="writeFrm" action="${pageType}/${siteIdx}/${boardIdx}/write.do" method="post"> --%>
<fieldset> <form:form name="writeFrm" id="writeFrm" action="/gtm/case/exam/${boardIdx}/write.do" method="post">
<div class="bbs-view-layout">
<div class="bbs-view-item"> <fieldset>
<p class="item-title">제목</p> <div class="bbs-view-layout">
<div class="item-box"> <div class="bbs-view-item">
<input type="text" name="examSubj" id="examSubj" maxlength="250"> <p class="item-title">제목</p>
</div> <div class="item-box">
</div> <input type="text" name="examSubj" id="examSubj" maxlength="250">
<div class="bbs-view-item"> </div>
<p class="item-title">작성자</p> </div>
<div class="item-box"> <div class="bbs-view-item">
${memberName} <p class="item-title">작성자</p>
</div> <div class="item-box">
</div> ${memberName}
<div class="bbs-view-item"> </div>
<p class="item-title">첨부자료</p> </div>
<div class="item-box"> <div class="bbs-view-item">
<div class="temp-file-area"> <p class="item-title">첨부자료</p>
<label for="upFile" class="temp-file-button">첨부파일</label> <div class="item-box">
</div> <div class="temp-file-area">
<ul class="upFileHtml" id="upFileHtml"> <label for="upFile" class="temp-file-button">첨부파일</label>
</div>
</ul> <ul class="upFileHtml" id="upFileHtml">
<input type="hidden" name="fileFuncType" value="exam" />
<input type="hidden" name="uploadFileCnt" value="0" id="uploadFileCntId" /> </ul>
<input type="hidden" name="deleteFileData" value="" id="deleteFileDataId" /> <input type="hidden" name="fileFuncType" value="exam" />
</div> <input type="hidden" name="uploadFileCnt" value="0" id="uploadFileCntId" />
</div> <input type="hidden" name="deleteFileData" value="" id="deleteFileDataId" />
<div class="bbs-view-item"> </div>
<p class="item-title">사건 유형 및 분류 선택</p> </div>
<div class="item-box"> <div class="bbs-view-item">
<select name="examTypeSell" id="examTypeSell" class="sel_default"> <p class="item-title">사건 유형 및 분류 선택</p>
<div class="item-box">
</select> <select name="examTypeSell" id="examTypeSell" class="sel_default">
<span> / </span> </select>
<select name="mediationBigType" id="mediationBigType" class="sch-select" onchange="mediationSmall()"> <span> / </span>
<option value="">대분류 선택</option>
<option value="big1" >불성립</option> <select name="mediationBigType" id="mediationBigType" class="sch-select" onchange="mediationSmall()">
<option value="big2" >성립</option> <option value="">대분류 선택</option>
<option value="big4" >심의</option> <option value="big1" >불성립</option>
<option value="big5" >종결</option> <option value="big2" >성립</option>
<option value="big3" >중지</option> <option value="big4" >심의</option>
</select> <option value="big5" >종결</option>
<option value="big3" >중지</option>
</div> </select>
</div>
<div class="bbs-view-item"> </div>
<p class="item-title">사건의 개요</p> </div>
<div class="item-box"> <div class="bbs-view-item">
<textarea class="bg_essential " name="editorParam_examCont" id="content" title="내용을 입력하세요" style="width:99%; height:300px;" editor="webnote" tools="deny:images,emoticon,special_chars"> <p class="item-title">사건의 개요</p>
</textarea> <div class="item-box">
</div> <textarea class="bg_essential " name="editorParam_examCont" id="content" title="내용을 입력하세요" style="width:99%; height:300px;" editor="webnote" tools="deny:images,emoticon,special_chars">
</div> </textarea>
<div class="bbs-view-item"> </div>
<p class="item-title">분쟁사실 및 당사자 주장</p> </div>
<div class="item-box"> <div class="bbs-view-item">
<textarea class="bg_essential " name="editorParam_examCont2" id="content" title="내용을 입력하세요" style="width:99%; height:300px;" editor="webnote" tools="deny:images,emoticon,special_chars"> <p class="item-title">분쟁사실 및 당사자 주장</p>
</textarea> <div class="item-box">
</div> <textarea class="bg_essential " name="editorParam_examCont2" id="content" title="내용을 입력하세요" style="width:99%; height:300px;" editor="webnote" tools="deny:images,emoticon,special_chars">
</div> </textarea>
<div class="bbs-view-item"> </div>
<p class="item-title">검토</p> </div>
<div class="item-box"> <div class="bbs-view-item">
<textarea class="bg_essential " name="editorParam_examCont3" id="content" title="내용을 입력하세요" style="width:99%; height:300px;" editor="webnote" tools="deny:images,emoticon,special_chars"> <p class="item-title">검토</p>
</textarea> <div class="item-box">
</div> <textarea class="bg_essential " name="editorParam_examCont3" id="content" title="내용을 입력하세요" style="width:99%; height:300px;" editor="webnote" tools="deny:images,emoticon,special_chars">
</div> </textarea>
<div class="bbs-view-item"> </div>
<p class="item-title">조정결과</p> </div>
<div class="item-box"> <div class="bbs-view-item">
<textarea class="bg_essential " name="editorParam_examCont4" id="content" title="내용을 입력하세요" style="width:99%; height:300px;" editor="webnote" tools="deny:images,emoticon,special_chars"> <p class="item-title">조정결과</p>
</textarea> <div class="item-box">
</div> <textarea class="bg_essential " name="editorParam_examCont4" id="content" title="내용을 입력하세요" style="width:99%; height:300px;" editor="webnote" tools="deny:images,emoticon,special_chars">
</div> </textarea>
</div> </div>
<input type="hidden" name="medBig2" id="medBig2" value=""> </div>
<input type="hidden" name="medSmall2" id="medSmall2" value=""> </div>
<input type="hidden" name="examType" id="examType" value=""> <input type="hidden" name="medBig2" id="medBig2" value="">
<div class="btn-area"> <input type="hidden" name="medSmall2" id="medSmall2" value="">
<button type="submit" class="btn-normal violet mb10">저장</button> <input type="hidden" name="examType" id="examType" value="">
<a href="javascript:goList()" class="btn-normal lightgray">목록</a> <div class="btn-area">
</div> <button type="submit" class="btn-normal violet mb10">저장</button>
</fieldset> <a href="javascript:goList()" class="btn-normal lightgray">목록</a>
</form:form> </div>
<!-- 파일 입시저장을 위한 폼 --> </fieldset>
<form id="fileTempUpFrm" action="/seed/extra/temp/file.do" method="post" enctype="multipart/form-data"> </form:form>
<input type="hidden" name="fileFuncType" value="exam" /> <!-- 파일 입시저장을 위한 폼 -->
<div class="temp-file-area"> <form id="fileTempUpFrm" action="/seed/extra/temp/file.do" method="post" enctype="multipart/form-data">
<input type="file" name="upFile" id="upFile" class="essential temp-file-hideen" onchange="fileTempUp();" required title="첨부파일" value="" style="ime-mode: disabled;" > <input type="hidden" name="fileFuncType" value="exam" />
</div> <div class="temp-file-area">
</form> <input type="file" name="upFile" id="upFile" class="essential temp-file-hideen" onchange="fileTempUp();" required title="첨부파일" value="" style="ime-mode: disabled;" >
<form name="paramFrm" id="paramFrm" action="/gtm/case/exam/${boardIdx}/list.do" method="get"> </div>
<input type="hidden" name="searchType" value="${param.searchType}"> </form>
<input type="hidden" name="searchTilte" value="${param.searchTilte}"> <form name="paramFrm" id="paramFrm" action="/gtm/case/exam/${boardIdx}/list.do" method="get">
<input type="hidden" name="page" id="page" value="${param.page}"> <input type="hidden" name="searchType" value="${param.searchType}">
<input type="hidden" name="searchTilte" value="${param.searchTilte}">
</form> <input type="hidden" name="page" id="page" value="${param.page}">
<%-- <form:form name="frm" id="frm" action="" method="post">
<input type="hidden" name="medBig" id="medBig" value=""> </form>
</form:form> --%> <%-- <form:form name="frm" id="frm" action="" method="post">
<script type="text/javascript"> <input type="hidden" name="medBig" id="medBig" value="">
</form:form> --%>
webnote.setConfig({ <script type="text/javascript">
auto_start: true, //페이지로딩시 페이지에 웹노트 에디터를 자동으로 생성할것인지(true: 자동생성, false: 생성안함)
lang: "UTF-8", //언어셋(lang 디렉토리내에 언어셋.txt 파일이 있어야 함(ex: ko.txt) webnote.setConfig({
base_dir: "/editor", //웹노트 설치디렉토리를 직접 지정 auto_start: true, //페이지로딩시 페이지에 웹노트 에디터를 자동으로 생성할것인지(true: 자동생성, false: 생성안함)
css_url: "/editor/webnote.css", //기본 css 파일을 직접 지정 lang: "UTF-8", //언어셋(lang 디렉토리내에 언어셋.txt 파일이 있어야 함(ex: ko.txt)
icon_dir: "/editor/icon", //기본 아이콘 디렉토리를 직접 지정 base_dir: "/editor", //웹노트 설치디렉토리를 직접 지정
emoticon_dir: "/editor/emoticon", //기본 이모티콘 디렉토리를 직접 지정 css_url: "/editor/webnote.css", //기본 css 파일을 직접 지정
attach_proc: "/common/proc/case/editor/editorFileReg.do", //에디터에 이미지 즉시 업로드를 처리하는 서버스크립트를 직접 지정 icon_dir: "/editor/icon", //기본 아이콘 디렉토리를 직접 지정
delete_proc: "/common/proc/case/editor/editorFileDel.do", //에디터에 즉시 업로드된 이미지 삭제를 처리하는 서버스크립트를 직접 지정(attach_proc 과 같을경우 설정 불필요) emoticon_dir: "/editor/emoticon", //기본 이모티콘 디렉토리를 직접 지정
use_blind: true, //팝업메뉴 출력 시 반투명 배경 스크린 사용여부(true:사용(기본), false: 미사용) attach_proc: "/common/proc/case/editor/editorFileReg.do", //에디터에 이미지 즉시 업로드를 처리하는 서버스크립트를 직접 지정
allow_dndupload: false, //드래그&드롭을 통한 이미지 파일 업로드 허용 여부 delete_proc: "/common/proc/case/editor/editorFileDel.do", //에디터에 즉시 업로드된 이미지 삭제를 처리하는 서버스크립트를 직접 지정(attach_proc 과 같을경우 설정 불필요)
allow_dndresize: false, //드래그&드롭을 통한 에디터 사이즈(높이) 조절 허용 여부 use_blind: true, //팝업메뉴 출력 시 반투명 배경 스크린 사용여부(true:사용(기본), false: 미사용)
//fonts: ["굴림체","궁서체"], //선택할 수 있는 폰트종류를 직접 정의 allow_dndupload: false, //드래그&드롭을 통한 이미지 파일 업로드 허용 여부
//fontsizes: ["9pt","10pt"], //선택할 수 있는 폰트사이즈를 직접 정의(단위포함) allow_dndresize: false, //드래그&드롭을 통한 에디터 사이즈(높이) 조절 허용 여부
lineheights: ["120%","150%","180%"], //선택할 수 있는 줄간격을 직접 정의(단위포함) //fonts: ["굴림체","궁서체"], //선택할 수 있는 폰트종류를 직접 정의
//emoticons: ["Nerd"], //선택할 수 있는 이모티콘들을 직접 정의(png파일은 확장자 생략 가능하며, 그외에는 확장자까지 입력 : PNG, GIF, JPG 만 가능) //fontsizes: ["9pt","10pt"], //선택할 수 있는 폰트사이즈를 직접 정의(단위포함)
//specialchars: ["§","☆"], //선택할 수 있는 특수문자를 직접 정의 lineheights: ["120%","150%","180%"], //선택할 수 있는 줄간격을 직접 정의(단위포함)
code_highlight: true, //emoticons: ["Nerd"], //선택할 수 있는 이모티콘들을 직접 정의(png파일은 확장자 생략 가능하며, 그외에는 확장자까지 입력 : PNG, GIF, JPG 만 가능)
fade_popup: true, //팝업 열리기/닫히기 시 fade in/out 기능 적용 여부(사용pc 사용이 낮은경우 false로 ) //specialchars: ["§","☆"], //선택할 수 있는 특수문자를 직접 정의
attach_list_view: false code_highlight: true,
}); fade_popup: true, //팝업 열리기/닫히기 시 fade in/out 기능 적용 여부(사용pc 사용이 낮은경우 false로 )
attach_list_view: false
});
$(window).load(function(){
$("#idx_toolbar_webnote_content_imagecenter").hide();
$(window).load(function(){
$("#idx_toolbarcontainer_webnote_content img").each(function(index, item) { $("#idx_toolbar_webnote_content_imagecenter").hide();
if($(item).attr("class") != "webnote_seperator"){
var event = $(item).attr("onclick"); $("#idx_toolbarcontainer_webnote_content img").each(function(index, item) {
$(item).wrap("<a href='javascript:;' onclick="+event+">"); if($(item).attr("class") != "webnote_seperator"){
$(item).attr("onclick", ""); var event = $(item).attr("onclick");
} $(item).wrap("<a href='javascript:;' onclick="+event+">");
}); $(item).attr("onclick", "");
}); }
});
$(document).ready(function(){ });
loadexamGubun(); $(document).ready(function(){
$("#writeFrm").submit(function(){ loadexamGubun();
if($("#examSubj").val().trim() == ""){
alert("제목을 입력해 주세요."); $("#writeFrm").submit(function(){
$("#examSubj").focus(); if($("#examSubj").val().trim() == ""){
return false; alert("제목을 입력해 주세요.");
} $("#examSubj").focus();
return false;
$("#examType").val($("#examTypeSell option:selected").text()); }
$("#medBig2").val($("#mediationBigType option:selected").text());
$("#medSmall2").val($("#mediationSmallType option:selected").text()); $("#examType").val($("#examTypeSell option:selected").text());
$("#medBig2").val($("#mediationBigType option:selected").text());
/* if($("#regMberNm").val().trim() == ""){ $("#medSmall2").val($("#mediationSmallType option:selected").text());
alert("작성자를 입력해 주세요.");
$("#regMberNm").focus(); /* if($("#regMberNm").val().trim() == ""){
return false; alert("작성자를 입력해 주세요.");
} */ $("#regMberNm").focus();
return false;
/* if($("#content").val() == ""){ } */
alert("내용을 입력해 주세요.");
$("#content").focus(); /* if($("#content").val() == ""){
return false; alert("내용을 입력해 주세요.");
} */ $("#content").focus();
}); return false;
}); } */
});
function goList(){ });
$("#paramFrm").submit();
function goList(){
$("#paramFrm").submit();
}
}
function loadexamGubun(){
var url = "";
$("#type").val("L"); function loadexamGubun(){
var url = "";
$("#boardIdxx").val(${boardIdx}); $("#type").val("L");
var param = jQuery('#frm').serialize();
url = "/user/case/Exam/ajax/BBsInfo.do"; $("#boardIdxx").val(${boardIdx});
var param = jQuery('#frm').serialize();
XHR2(url, param, function(r){ url = "/user/case/Exam/ajax/BBsInfo.do";
var html2 = "";
if(r.data.length != 0){ XHR2(url, param, function(r){
$("#examTypeSell").empty(); var html2 = "";
$.each(r.data, function(k,v){
html2 += '<option name=search value='+v.value+'>'+v.value+'</option>'; if(r.data.length != 0){
}) $("#examTypeSell").empty();
$("#examTypeSell").append(html2);
} $.each(r.data, function(k,v){
}) html2 += '<option name=search value='+v.value+'>'+v.value+'</option>';
})
}
$("#examTypeSell").append(html2);
</script> }
<script src="/js/jquery.form.js"></script> })
<script src="/js/seedFileUtil.js"></script>
</body> }
</script>
<script src="/js/jquery.form.js"></script>
<script src="/js/seedFileUtil.js"></script>
</body>
</html> </html>

View File

@ -2,6 +2,70 @@
* jQuery AJAX * jQuery AJAX
*/ */
function XHR(url, data, callbackFunc, exceptionFunc , localStartFunc , localEndFunc){ function XHR(url, data, callbackFunc, exceptionFunc , localStartFunc , localEndFunc){
$.blockUI({ message : '<h1><img src="/img/blockbusy.gif" />&nbsp;&nbsp;잠시만 기다려주세요.</h1>' });
$.ajax({
url: url,
type: "POST",
dataType: "html",
//data: data + "&IS_AJAX_REQUEST=IS_AJAX_REQUEST",
contentType: 'application/x-www-form-urlencoded; charset=utf-8',
data: data,
async: true,
cache: false,
success: function (data, textStatus) {
var result;
try{
console.log(data);
result = eval('(' + data + ')');
}catch(ex){
$.unblockUI();
alert(ex);
}
if( typeof(result) == 'object' ){ // JSON 오프젝트로 받음(리턴값이 JSON이거나 Exception 발생시)
if(result._EXCEPTION_){
if(exceptionFunc){ // 익셉션 처리 함수가 있으면
$.unblockUI();
exceptionFunc(result._EXCEPTION_);
}else{
$.unblockUI();
_processException(result._EXCEPTION_);
}
}else if(result._SESSION_OUT_){ // 세션 아웃 처리
alert(result._SESSION_OUT_.message);
if(result._SESSION_OUT_.redirectUrl !=""){
$.unblockUI();
parent.location.href= redirectUrl;
}
}else{
if(callbackFunc){ // 익셉션이 아니고 callback 펑션이 있을때.
$.unblockUI();
callbackFunc(result);
}
}
}else{
if(callbackFunc){ // HTML 형식의 리턴이며 callback 펑션이 있을때.
$.unblockUI();
callbackFunc(data);
}
}
},
beforeSend : function(){ // 로컬 이벤트 , 시작
if(localStartFunc){
$.unblockUI();
localStartFunc();
}
},
complete: function(){ // 로컬 이벤트 , 끝
if(localEndFunc){
$.unblockUI();
localEndFunc();
}
}
});
}
function XHR_OLD(url, data, callbackFunc, exceptionFunc , localStartFunc , localEndFunc){
$.blockUI({ message : '<h1><img src="/img/blockbusy.gif" />&nbsp;&nbsp;잠시만 기다려주세요.</h1>' }); $.blockUI({ message : '<h1><img src="/img/blockbusy.gif" />&nbsp;&nbsp;잠시만 기다려주세요.</h1>' });
jQuery.ajax({ jQuery.ajax({
url: url, url: url,
@ -64,9 +128,86 @@
} }
}); });
} }
//비동기 false //비동기 false
function XHR2(url, data, callbackFunc, exceptionFunc , localStartFunc , localEndFunc){ function XHR2(url, data, callbackFunc, exceptionFunc , localStartFunc , localEndFunc){
$.blockUI({ message : '<h1><img src="/img/blockbusy.gif" />&nbsp;&nbsp;잠시만 기다려주세요.</h1>' });
$.ajax({
url: url,
type: "POST",
dataType: "html",
//data: data + "&IS_AJAX_REQUEST=IS_AJAX_REQUEST",
contentType: 'application/x-www-form-urlencoded; charset=utf-8',
data: data,
async: false,
cache: false,
success: function (data, textStatus) {
var result;
try{
//시큐어코딩 관련 session이 들어가 있으면 신텍스 에러나기 떄문에 삭제
/* data = data.replace('"SpringSecurityFiltersecurityinterceptorFilterapplied":true,','');
data = data.replace('"SpringSecuritySessionMgmtFilterApplied":true,','');
data = data.replace('"springSecurityContext":org.springframework.security.core.context.SecurityContextImpl@689a8480: Authentication: org.springframework.security.authentication.UsernamePasswordAuthenticationToken@689a8480: Principal: soattorney; Credentials: [PROTECTED]; Authenticated: true; Details: seed.security.SecurityUserDetails@b15278a; Granted Authorities: ROLE_USER,','');
data = data.replace('"springSecurityContext":org.springframework.security.core.context.SecurityContextImpl@7ef97b48: Authentication: org.springframework.security.authentication.UsernamePasswordAuthenticationToken@7ef97b48: Principal: soattorney; Credentials: [PROTECTED]; Authenticated: true; Details: seed.security.SecurityUserDetails@1d76d842; Granted Authorities: ROLE_USER,','');
data = data.replace('"SpringSecurityScpfApplied":true,','');
data = data.replace('"springSecurityContext":org.springframework.security.core.context.SecurityContextImpl@e3239a3: Authentication: org.springframework.security.authentication.UsernamePasswordAuthenticationToken@e3239a3: Principal: soattorney; Credentials: [PROTECTED]; Authenticated: true; Details: seed.security.SecurityUserDetails@6dbd9aa9; Granted Authorities: ROLE_USER,','');
*/
//20191004 주석.
//console.log(data);
result = eval('(' + data + ')');
}catch(ex){
$.unblockUI();
alert(ex);
}
if( typeof(result) == 'object' ){ // JSON 오프젝트로 받음(리턴값이 JSON이거나 Exception 발생시)
if(result._EXCEPTION_){
if(exceptionFunc){ // 익셉션 처리 함수가 있으면
exceptionFunc(result._EXCEPTION_);
$.unblockUI();
}else{
_processException(result._EXCEPTION_);
$.unblockUI();
}
}else if(result._SESSION_OUT_){ // 세션 아웃 처리
alert(result._SESSION_OUT_.message);
if(result._SESSION_OUT_.redirectUrl !=""){
$.unblockUI();
parent.location.href= redirectUrl;
}
}else{
if(callbackFunc){ // 익셉션이 아니고 callback 펑션이 있을때.
$.unblockUI();
callbackFunc(result);
}
}
}else{
if(callbackFunc){ // HTML 형식의 리턴이며 callback 펑션이 있을 때.
$.unblockUI();
callbackFunc(data);
}
}
},
beforeSend : function(){ // 로컬 이벤트, 시작
if(localStartFunc){
$.unblockUI();
localStartFunc();
}
},
complete: function(){ // 로컬 이벤트, 끝
if(localEndFunc){
$.unblockUI();
localEndFunc();
}
}
});
}
//비동기 false
function XHR2_OLD(url, data, callbackFunc, exceptionFunc , localStartFunc , localEndFunc){
// $.blockUI({ message : '<h1><img src="/img/blockbusy.gif" />&nbsp;&nbsp;잠시만 기다려주세요.</h1>' }); // $.blockUI({ message : '<h1><img src="/img/blockbusy.gif" />&nbsp;&nbsp;잠시만 기다려주세요.</h1>' });
jQuery.ajax({ jQuery.ajax({
url: url, url: url,