# 초기 설정 관련

**URL:** https://forum.developer.hancom.com/t/topic/1048
**Category:** 웹한글 기안기
**Created:** [11월 7, 2023, 4:41오전 UTC](https://forum.developer.hancom.com/t/topic/1048 "2023-11-07T04:41:09Z")
**Posts on this page:** 9
**Page:** 1

<div class="post-metadata">

### Author: ![lbh](https://avatars.discourse-cdn.com/v4/letter/l/65b543/32.png) [@lbh](https://forum.developer.hancom.com/u/lbh)
#### Post date: [11월 7, 2023, 4:41오전 UTC](https://forum.developer.hancom.com/t/topic/1048/1 "2023-11-07T04:41:09Z")

</div>

현재 한글웹기안기 서버 (톰캣), 프로젝트 WAS 서버를 분리하여 사용하고 있습니다.

한글웹기안기 서버 상에서 테스트 페이지는 띄워봤는데 프로젝트 WAS와 연결하여 띄우려니 잘 안되는 부분이 있어 질문드립니다.

1. index.html head 부분  
script src="웹기안기서버ip:포트/js/hwpctrlapp/utils/util.js  
script src=“웹기안기서버ip:포트/js/hwpctrlapp/hwpCtrlApp.js”  
script src=“웹기안기서버ip:포트/js/webhwpctrl.js”  
이렇게 사용하면 되는지

2. BuildWebHwpCtrl(“hwpctrl”, location.href, function () {}, 2); 을 사용하여 객체를 생성할때 baseUrl은 프로젝트 WAS 서버로 잡으면 되는지

---

<div class="post-metadata">

### Author: ![bart](https://avatars.discourse-cdn.com/v4/letter/b/f19dbf/32.png) [@bart](https://forum.developer.hancom.com/u/bart)
#### Post date: [11월 7, 2023, 7:13오전 UTC](https://forum.developer.hancom.com/t/topic/1048/2 "2023-11-07T07:13:44Z")

</div>

안녕하세요.

> 1. index.html head 부분  
> script src="웹기안기서버ip:포트/js/hwpctrlapp/utils/util.js  
> script src=“웹기안기서버ip:포트/js/hwpctrlapp/hwpCtrlApp.js”  
> script src=“웹기안기서버ip:포트/js/webhwpctrl.js”  
> 이렇게 사용하면 되는지

기안기 javascript 사용시 기안기 서버에서 불러오도록 다음과 같이 설정 하시면 됩니다.

기안기 서버 경로 사용

```auto
<head>
  <script src="웹기안기서버ip:포트/webhwpctrl/js/hwpctrlapp/utils/util.js />
  <script src=“웹기안기서버ip:포트/webhwpctrl/js/hwpctrlapp/hwpCtrlApp.js” />
  <script src=“웹기안기서버ip:포트/webhwpctrl/js/webhwpctrl.js” />
</head>

```

or base 태그 사용하여 상대경로

```auto
<head>
  <base href="웹기안기서버ip:포트/webhwpctrl" >
  <script src="js/hwpctrlapp/utils/util.js />
  <script src=“js/hwpctrlapp/hwpCtrlApp.js” />
  <script src=“js/webhwpctrl.js” />
</head>

```

> 1. BuildWebHwpCtrl(“hwpctrl”, location.href, function () {}, 2); 을 사용하여 객체를 생성할때 baseUrl은 프로젝트 WAS 서버로 잡으면 되는지

baseUrl 은 웹기안기 주소로 잡아야 합니다.

```auto
BuildWebHwpCtrl("hwpctrl", "웹기안기서버ip:포트/webhwpctrl", callback);

```

---

<div class="post-metadata">

### Author: ![lbh](https://avatars.discourse-cdn.com/v4/letter/l/65b543/32.png) [@lbh](https://forum.developer.hancom.com/u/lbh)
#### Post date: [11월 8, 2023, 4:12오전 UTC](https://forum.developer.hancom.com/t/topic/1048/3 "2023-11-08T04:12:34Z")

</div>

안녕하세요.

현재 Uncaught DOMException: Failed to read a named property ‘href’ from ‘Location’: Blocked a frame with origin “웹기안기서버ip:포트” from accessing a cross-origin frame. 에러가 발생하는데 해결방법이 있을까요?

---

<div class="post-metadata">

### Author: ![bart](https://avatars.discourse-cdn.com/v4/letter/b/f19dbf/32.png) [@bart](https://forum.developer.hancom.com/u/bart)
#### Post date: [11월 8, 2023, 4:27오전 UTC](https://forum.developer.hancom.com/t/topic/1048/4 "2023-11-08T04:27:34Z")

</div>

안녕하세요.

cross domain 이슈인것 같은데요.  
어떤 동작을 할때 발생했는지 사용하신 코드를 첨부해주시면 확인 가능할것 같습니다.

---

<div class="post-metadata">

### Author: ![lbh](https://avatars.discourse-cdn.com/v4/letter/l/65b543/32.png) [@lbh](https://forum.developer.hancom.com/u/lbh)
#### Post date: [11월 8, 2023, 4:39오전 UTC](https://forum.developer.hancom.com/t/topic/1048/5 "2023-11-08T04:39:51Z")

</div>

BuildWebHwpCtrl(“hwpctrl”, “[http://웹기안기ip](http://xn--ip-h52ia3760agec):포트/webhwpctrl/”, function () { }); 사용할 때 발생합니다.

---

<div class="post-metadata">

### Author: ![lbh](https://avatars.discourse-cdn.com/v4/letter/l/65b543/32.png) [@lbh](https://forum.developer.hancom.com/u/lbh)
#### Post date: [11월 8, 2023, 5:52오전 UTC](https://forum.developer.hancom.com/t/topic/1048/6 "2023-11-08T05:52:29Z")

</div>

Uncaught DOMException: Failed to set a named property ‘callbackFn’ on ‘Window’: Blocked a frame with origin “[http://프로젝트서버ip](http://xn--ip-oj9ij1l8xgmvl9uslge):포트” from accessing a cross-origin frame.  
at iframe.onload ([http://웹기안기ip](http://xn--ip-h52ia3760agec):포트/webhwpctrl/js/hwpctrlapp/hwpCtrlApp.js:82:34)

이 에러도 같이 발생합니다.

---

<div class="post-metadata">

### Author: ![bart](https://avatars.discourse-cdn.com/v4/letter/b/f19dbf/32.png) [@bart](https://forum.developer.hancom.com/u/bart)
#### Post date: [11월 8, 2023, 6:16오전 UTC](https://forum.developer.hancom.com/t/topic/1048/7 "2023-11-08T06:16:35Z")

</div>

WAS 서버에 웹한글 기안기 연동을 위한 HTML 이 있어야 합니다.  
WAS 서버의 HTML 에서 웹한글기안기 서버의 js 를 사용하는 방식입니다.  
WAS서버에서 웹한글 기안기 표현을 위한 iframe 에 WAS서버의 기안기 연동을 위한 html 을 포함하여야 합니다.

혹시 웹한글 기안기 서버의 html 을 WAS 서버에서 iframe 으로 포함한것 아닌가요?

---

<div class="post-metadata">

### Author: ![lbh](https://avatars.discourse-cdn.com/v4/letter/l/65b543/32.png) [@lbh](https://forum.developer.hancom.com/u/lbh)
#### Post date: [11월 8, 2023, 6:31오전 UTC](https://forum.developer.hancom.com/t/topic/1048/8 "2023-11-08T06:31:57Z")

</div>

네… 그럼 웹한글 기안기 서버에 있는 hwpctrlmain.html을 WAS 서버로 가져와서 사용하면 될까요?

---

<div class="post-metadata">

### Author: ![bart](https://avatars.discourse-cdn.com/v4/letter/b/f19dbf/32.png) [@bart](https://forum.developer.hancom.com/u/bart)
#### Post date: [11월 8, 2023, 6:52오전 UTC](https://forum.developer.hancom.com/t/topic/1048/9 "2023-11-08T06:52:49Z")

</div>

네.  
hwpctrlmain.html 및 연동을 위한 Index.html 도 WAS 서버로 가져와야 하고  
해당 html 의 base url 을 기안기 서버로 설정을 해야 합니다.

담당 영업사원 통해서 연동 관련 기술 가이드를 받으시는게 좋을것 같습니다.
