팝업창에 값이 전달되지 않습니다.
- 작성자 :
- 이*재
- 작성일 :
- 2012-07-12 11:29:36
- 조회수 :
- 1,828
- 구분 :
- 공통컴포넌트
- 진행상태 :
- 완료
Q
안녕하세요? 항상 수고가 많으십니다.
전자정부 프레임 워크를 공개하여 주셔서 감사드립니다.
web core를 깔고, 여기에 게시판 컴포넌트를 설치하였습니다.
게시판 템플릿 관련 설정을 하려는데 팝업창이 뜨지를 않습니다.
(정확하게는 blank로 뜹니다.)
다른분들도 같은 문제가 있으신 분이 계신것 같더라구요.
관련 소스를 수정해서 구동해 보았습니다.
@RequestMapping("/cop/com/openPopup.do")
public String openPopupWindow(Map<String, Object> commandMap, ModelMap model) throws Exception {
String requestUrl = (String)commandMap.get("requestUrl");
String trgetId = (String)commandMap.get("trgetId");
String width = (String)commandMap.get("width");
String height = (String)commandMap.get("height");
String typeFlag = (String)commandMap.get("typeFlag");
<!--------- 추가된 부분 : 인수의 출력 --------------->
System.out.println("requesturl: "+requestUrl);
System.out.println("trgetId: "+trgetId);
System.out.println("width: "+width);
System.out.println("height: "+height);
System.out.println("typeFlag: "+typeFlag);
<!--------- 추가된 부분 : 인수의 출력 --------------->
//log.debug(this.getClass().getName()+">>>>requestUrl Before "+requestUrl);
//log.debug(this.getClass().getName()+">>>>trgetId Before "+trgetId);
//log.debug(this.getClass().getName()+">>>>typeFlag Before "+typeFlag);
if (trgetId != null && trgetId != "") {
if (typeFlag != null && typeFlag != "") {
model.addAttribute("requestUrl", requestUrl + "?trgetId=" + trgetId + "&PopFlag=Y&typeFlag=" + typeFlag);
} else {
model.addAttribute("requestUrl", requestUrl + "?trgetId=" + trgetId + "&PopFlag=Y");
}
} else {
if (typeFlag != null && typeFlag != "") {
model.addAttribute("requestUrl", requestUrl + "?PopFlag=Y&typeFlag=" + typeFlag);
} else {
model.addAttribute("requestUrl", requestUrl + "?PopFlag=Y");
}
}
model.addAttribute("width", width);
model.addAttribute("height", height);
return "egovframework/com/cop/com/EgovModalPopupFrame";
}
Console 창에는 아래와 같이 뜹니다.
requesturl: null
trgetId: null
width: null
height: null
typeFlag: null
앞에서 말씀드린 템플릿 설정부분에서 팝업창을 띄우면 다음과 같은 주소가 웹브라우저에 찍힙니다.
http://localhost:8080/portal/cop/com/openPopup.do?requestUrl=/cop/tpl/selectTemplateInfsPop.do&typeFlag=BBS&width=850&height=360
model에 requestUrl, width, height, 속성들을 강제로 부여해 보면,
해당하는 화면이 뜨는 것으로 보아, 제가 생각하기로는 값이 전달되지 않는 것 같은데,
이런 것을 어떻게 해결해야 할지 혹시 해결된 부분이 있으시면,
안내 부탁드립니다.
답변에 미리 감사드리며, 좋은 하루 보내시길 바랍니다.
전자정부 프레임 워크를 공개하여 주셔서 감사드립니다.
web core를 깔고, 여기에 게시판 컴포넌트를 설치하였습니다.
게시판 템플릿 관련 설정을 하려는데 팝업창이 뜨지를 않습니다.
(정확하게는 blank로 뜹니다.)
다른분들도 같은 문제가 있으신 분이 계신것 같더라구요.
관련 소스를 수정해서 구동해 보았습니다.
@RequestMapping("/cop/com/openPopup.do")
public String openPopupWindow(Map<String, Object> commandMap, ModelMap model) throws Exception {
String requestUrl = (String)commandMap.get("requestUrl");
String trgetId = (String)commandMap.get("trgetId");
String width = (String)commandMap.get("width");
String height = (String)commandMap.get("height");
String typeFlag = (String)commandMap.get("typeFlag");
<!--------- 추가된 부분 : 인수의 출력 --------------->
System.out.println("requesturl: "+requestUrl);
System.out.println("trgetId: "+trgetId);
System.out.println("width: "+width);
System.out.println("height: "+height);
System.out.println("typeFlag: "+typeFlag);
<!--------- 추가된 부분 : 인수의 출력 --------------->
//log.debug(this.getClass().getName()+">>>>requestUrl Before "+requestUrl);
//log.debug(this.getClass().getName()+">>>>trgetId Before "+trgetId);
//log.debug(this.getClass().getName()+">>>>typeFlag Before "+typeFlag);
if (trgetId != null && trgetId != "") {
if (typeFlag != null && typeFlag != "") {
model.addAttribute("requestUrl", requestUrl + "?trgetId=" + trgetId + "&PopFlag=Y&typeFlag=" + typeFlag);
} else {
model.addAttribute("requestUrl", requestUrl + "?trgetId=" + trgetId + "&PopFlag=Y");
}
} else {
if (typeFlag != null && typeFlag != "") {
model.addAttribute("requestUrl", requestUrl + "?PopFlag=Y&typeFlag=" + typeFlag);
} else {
model.addAttribute("requestUrl", requestUrl + "?PopFlag=Y");
}
}
model.addAttribute("width", width);
model.addAttribute("height", height);
return "egovframework/com/cop/com/EgovModalPopupFrame";
}
Console 창에는 아래와 같이 뜹니다.
requesturl: null
trgetId: null
width: null
height: null
typeFlag: null
앞에서 말씀드린 템플릿 설정부분에서 팝업창을 띄우면 다음과 같은 주소가 웹브라우저에 찍힙니다.
http://localhost:8080/portal/cop/com/openPopup.do?requestUrl=/cop/tpl/selectTemplateInfsPop.do&typeFlag=BBS&width=850&height=360
model에 requestUrl, width, height, 속성들을 강제로 부여해 보면,
해당하는 화면이 뜨는 것으로 보아, 제가 생각하기로는 값이 전달되지 않는 것 같은데,
이런 것을 어떻게 해결해야 할지 혹시 해결된 부분이 있으시면,
안내 부탁드립니다.
답변에 미리 감사드리며, 좋은 하루 보내시길 바랍니다.
A
안녕하세요.. 이광재님..
Map으로 파라미터를 받아 처리하기 위해서는 별도의 설정이 필요합니다.
이 설정이 없어서.. 파라미터들을 받지 못한 경우입니다..
WEB-INF/config/egovframework/egov-com-servlet.xml(적용하신 방법에 따라 다른 파일일 수도 있음)에 다음과 같은 customArgumentResolvers 등록이 필요합니다.
<bean class="org.springframework.web.servlet.mvc.annotation.AnnotationMethodHandlerAdapter">
<property name="webBindingInitializer">
<bean class="egovframework.com.cmm.web.EgovBindingInitializer"/>
</property>
<property name="customArgumentResolvers">
<list>
<bean class="egovframework.rte.ptl.mvc.bind.CommandMapArgumentResolver"/>
</list>
</property>
</bean>
그럼.. 즐거운 하루되십시오.
감사합니다.
Map으로 파라미터를 받아 처리하기 위해서는 별도의 설정이 필요합니다.
이 설정이 없어서.. 파라미터들을 받지 못한 경우입니다..
WEB-INF/config/egovframework/egov-com-servlet.xml(적용하신 방법에 따라 다른 파일일 수도 있음)에 다음과 같은 customArgumentResolvers 등록이 필요합니다.
<bean class="org.springframework.web.servlet.mvc.annotation.AnnotationMethodHandlerAdapter">
<property name="webBindingInitializer">
<bean class="egovframework.com.cmm.web.EgovBindingInitializer"/>
</property>
<property name="customArgumentResolvers">
<list>
<bean class="egovframework.rte.ptl.mvc.bind.CommandMapArgumentResolver"/>
</list>
</property>
</bean>
그럼.. 즐거운 하루되십시오.
감사합니다.