map으로 파라메타 값 안 넘어오네요
- 작성자 :
- 정*선
- 작성일 :
- 2011-06-17 17:27:32
- 조회수 :
- 2,432
- 구분 :
- 실행환경
- 진행상태 :
- 완료
Q
map 으로 파라메타를 받으려구 합니다.
특별한 이유가 없는듯한데..오류두 없구요.. 값이 안 넘어오네요...ㅠㅠ
혹시 다른 어떤 설정이 필요한것인지요?
@RequestMapping(value="/test/departmentList.do")
public String departmentList(Map<String, String> commandMap, ModelMap model)
throws Exception {
System.out.println("my test");
Iterator it = commandMap.keySet().iterator();
while (it.hasNext()) {
String key = (String) it.next();
System.out.print("key="+key);
System.out.println(" value="+commandMap.get(key));
}
List<DepartmentVO> departmentList = departmentService.getDepartmentList(commandMap);
model.addAttribute("departmentList", departmentList);
return "/test/departmentList";
}
특별한 이유가 없는듯한데..오류두 없구요.. 값이 안 넘어오네요...ㅠㅠ
혹시 다른 어떤 설정이 필요한것인지요?
@RequestMapping(value="/test/departmentList.do")
public String departmentList(Map<String, String> commandMap, ModelMap model)
throws Exception {
System.out.println("my test");
Iterator it = commandMap.keySet().iterator();
while (it.hasNext()) {
String key = (String) it.next();
System.out.print("key="+key);
System.out.println(" value="+commandMap.get(key));
}
List<DepartmentVO> departmentList = departmentService.getDepartmentList(commandMap);
model.addAttribute("departmentList", departmentList);
return "/test/departmentList";
}
A
안녕하세요.. 정영선님..
다음과 같은.. CommandMapArgumentResolver 설정이 필요합니다.
web layer 부분에 설정에 추가하시면 됩니다. (ViewResolver 설정이 있는 위치)
<bean class="org.springframework.web.servlet.mvc.annotation.AnnotationMethodHandlerAdapter">
<property name="customArgumentResolvers">
<list>
<bean class="egovframework.rte.ptl.mvc.bind.CommandMapArgumentResolver"/>
</list>
</property>
</bean>
그럼.. 즐거운 하루되십시오.
감사합니다.
다음과 같은.. CommandMapArgumentResolver 설정이 필요합니다.
web layer 부분에 설정에 추가하시면 됩니다. (ViewResolver 설정이 있는 위치)
<bean class="org.springframework.web.servlet.mvc.annotation.AnnotationMethodHandlerAdapter">
<property name="customArgumentResolvers">
<list>
<bean class="egovframework.rte.ptl.mvc.bind.CommandMapArgumentResolver"/>
</list>
</property>
</bean>
그럼.. 즐거운 하루되십시오.
감사합니다.