Merge branch 'master' of http://subsub8729@vcs.iten.co.kr:9999/hylee/mjon_git
@070315b1b0363574a39828f70c63406747499bf2
--- src/main/java/itn/let/mjo/test/web/TestController.java
+++ src/main/java/itn/let/mjo/test/web/TestController.java
... | ... | @@ -42,6 +42,7 @@ |
| 42 | 42 |
import org.springframework.http.MediaType; |
| 43 | 43 |
import org.springframework.http.ResponseEntity; |
| 44 | 44 |
import org.springframework.stereotype.Controller; |
| 45 |
+import org.springframework.ui.Model; |
|
| 45 | 46 |
import org.springframework.ui.ModelMap; |
| 46 | 47 |
import org.springframework.util.LinkedMultiValueMap; |
| 47 | 48 |
import org.springframework.util.MultiValueMap; |
... | ... | @@ -3501,5 +3502,40 @@ |
| 3501 | 3502 |
|
| 3502 | 3503 |
} |
| 3503 | 3504 |
|
| 3505 |
+ |
|
| 3506 |
+ @RequestMapping("/uss/ion/test/callNicepay.do")
|
|
| 3507 |
+ public String callNicepay(Model model) {
|
|
| 3508 |
+ String url = "https://dev.nicepay.co.kr/webapi/sslConnectionTest.jsp"; |
|
| 3509 |
+ String mid = "itn180208m"; // 실제 MID 값으로 변경 |
|
| 3510 |
+ |
|
| 3511 |
+ try {
|
|
| 3512 |
+ // RestTemplate 사용 |
|
| 3513 |
+ RestTemplate restTemplate = new RestTemplate(); |
|
| 3514 |
+ |
|
| 3515 |
+ // 헤더 설정 |
|
| 3516 |
+ HttpHeaders headers = new HttpHeaders(); |
|
| 3517 |
+ headers.setContentType(MediaType.APPLICATION_FORM_URLENCODED); |
|
| 3518 |
+ |
|
| 3519 |
+ // 파라미터 설정 |
|
| 3520 |
+ MultiValueMap<String, String> params = new LinkedMultiValueMap<>(); |
|
| 3521 |
+ params.add("MID", mid);
|
|
| 3522 |
+ |
|
| 3523 |
+ HttpEntity<MultiValueMap<String, String>> request = new HttpEntity<>(params, headers); |
|
| 3524 |
+ |
|
| 3525 |
+ // POST 요청 |
|
| 3526 |
+ ResponseEntity<String> response = restTemplate.postForEntity(url, request, String.class); |
|
| 3527 |
+ |
|
| 3528 |
+ // JSP에 전달 |
|
| 3529 |
+ model.addAttribute("result", response.getBody());
|
|
| 3530 |
+ model.addAttribute("url", url);
|
|
| 3531 |
+ model.addAttribute("mid", mid);
|
|
| 3532 |
+ |
|
| 3533 |
+ } catch (Exception e) {
|
|
| 3534 |
+ model.addAttribute("result", "에러 발생: " + e.getMessage());
|
|
| 3535 |
+ } |
|
| 3536 |
+ |
|
| 3537 |
+ return "uss/ion/test/TestNicePaySSL"; // nicepayResult.jsp로 이동 |
|
| 3538 |
+ } |
|
| 3539 |
+ |
|
| 3504 | 3540 |
|
| 3505 | 3541 |
} |
+++ src/main/webapp/WEB-INF/jsp/uss/ion/test/TestNicePaySSL.jsp
... | ... | @@ -0,0 +1,57 @@ |
| 1 | +<%@ page contentType="text/html; charset=utf-8"%> | |
| 2 | +<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %> | |
| 3 | +<%@ taglib prefix="ui" uri="http://egovframework.gov/ctl/ui"%> | |
| 4 | +<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions"%> | |
| 5 | +<%@ taglib prefix="spring" uri="http://www.springframework.org/tags"%> | |
| 6 | + | |
| 7 | + | |
| 8 | +<html lang="ko"> | |
| 9 | +<head> | |
| 10 | +<title>세금계산서 관리</title> | |
| 11 | +<meta http-equiv="content-type" content="text/html; charset=utf-8"> | |
| 12 | +</head> | |
| 13 | +<body> | |
| 14 | + <div class="contWrap"> | |
| 15 | + <div class="pageTitle"> | |
| 16 | + <div class="pageIcon"><img src="/pb/img/pageTitIcon4.png" alt=""></div> | |
| 17 | + <h2 class="titType1 c_222222 fwBold">Nicepay SSL 호출 결과</h2> | |
| 18 | + <p class="tType6 c_999999">Nicepay SSL 호출 결과</p> | |
| 19 | + </div> | |
| 20 | + <div class="pageCont"> | |
| 21 | + <!-- 세금계산서 --> | |
| 22 | + <div class="tableWrap"> | |
| 23 | + <table class="tbType1"> | |
| 24 | + <colgroup> | |
| 25 | + <col style="width: 40%"> | |
| 26 | + <col style="width: 20%"> | |
| 27 | + <col style="width: 40%"> | |
| 28 | + </colgroup> | |
| 29 | + <thead> | |
| 30 | + <tr> | |
| 31 | + <th>url</th> | |
| 32 | + <th>mid</th> | |
| 33 | + <th>결과</th> | |
| 34 | + </tr> | |
| 35 | + </thead> | |
| 36 | + <tbody> | |
| 37 | + <tr> | |
| 38 | + <td> | |
| 39 | + ${url} | |
| 40 | + </td> | |
| 41 | + <td> | |
| 42 | + ${mid} | |
| 43 | + </td> | |
| 44 | + <td> | |
| 45 | + ${result} | |
| 46 | + </td> | |
| 47 | + </tr> | |
| 48 | + </tbody> | |
| 49 | + </table> | |
| 50 | + </div> | |
| 51 | + <div class="btnWrap"> | |
| 52 | + </div> | |
| 53 | + </div> | |
| 54 | + </div> | |
| 55 | + | |
| 56 | +</body> | |
| 57 | +</html>(No newline at end of file) |
Add a comment
Delete comment
Once you delete this comment, you won't be able to recover it. Are you sure you want to delete this comment?