1 |
/** |
---|
2 |
* |
---|
3 |
*/ |
---|
4 |
package org.springframework.samples.kyuriboard.web.spring; |
---|
5 |
|
---|
6 |
import javax.servlet.http.HttpServletRequest; |
---|
7 |
import javax.servlet.http.HttpServletResponse; |
---|
8 |
|
---|
9 |
import org.springframework.web.servlet.ModelAndView; |
---|
10 |
import org.springframework.web.servlet.mvc.Controller; |
---|
11 |
|
---|
12 |
import org.springframework.samples.kyuriboard.domain.logic.KyuriBoardFacade; |
---|
13 |
|
---|
14 |
/** |
---|
15 |
* @author DAMI(archy712@naver.com) |
---|
16 |
* |
---|
17 |
*/ |
---|
18 |
public class DeleteBoardController implements Controller { |
---|
19 |
|
---|
20 |
private KyuriBoardFacade kyuriBoard; |
---|
21 |
|
---|
22 |
private String successView; |
---|
23 |
|
---|
24 |
/** |
---|
25 |
* @param kyuriBoard the kyuriBoard to set |
---|
26 |
*/ |
---|
27 |
public void setKyuriBoard(KyuriBoardFacade kyuriBoard) { |
---|
28 |
this.kyuriBoard = kyuriBoard; |
---|
29 |
} |
---|
30 |
|
---|
31 |
|
---|
32 |
/** |
---|
33 |
* @param successView the successView to set |
---|
34 |
*/ |
---|
35 |
public void setSuccessView(String successView) { |
---|
36 |
this.successView = successView; |
---|
37 |
} |
---|
38 |
|
---|
39 |
|
---|
40 |
/* (non-Javadoc) |
---|
41 |
* @see org.springframework.web.servlet.mvc.Controller#handleRequest(javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse) |
---|
42 |
*/ |
---|
43 |
public ModelAndView handleRequest(HttpServletRequest request, |
---|
44 |
HttpServletResponse response) throws Exception { |
---|
45 |
// TODO Auto-generated method stub |
---|
46 |
int boardId = new Integer(request.getParameter("boardId")).intValue(); |
---|
47 |
this.kyuriBoard.deleteBoard(boardId); |
---|
48 |
this.kyuriBoard.deleteMemoByBoardId(boardId); |
---|
49 |
return new ModelAndView(this.successView); |
---|
50 |
} |
---|
51 |
|
---|
52 |
} |
---|