2018. 5. 24. 17:09 개발
여러값을 배열로 받아서 처리
@RequestMapping("update.do")
public String update(@RequestParam int[] amount,
@RequestParam int[] product_id, HttpSession session) {
String userid = (String)session.getAttribute("userid");
if(userid != null) {
for(int i=0; i < product_id.length; i++) {
CartDTO dto = new CartDTO();
dto.setUserid(userid);
dto.setProduct_id(product_id[i]);
dto.setAmount(amount[i]);
cartService.modifyCart(dto);
}
}
return "redirect:/shop/cart/list.do";
}
스프링 디버깅
1개의 프로젝트만 open
clean
- Project - clean : 소스 코드 강제 컴파일
Servers
- clean 서버 클리어
- clean Tomcat work di~ 톰캣 작업 디렉토리
maven - update project
'개발' 카테고리의 다른 글
코드로 spring (0) | 2018.05.27 |
---|---|
admin table (0) | 2018.05.25 |
MemberDTO (0) | 2018.05.21 |
spring 파일 업로드 (0) | 2018.05.21 |
Spring 흐름 (0) | 2018.05.21 |