BoardController
페이지 정보
본문
package web.controller;
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.servlet.ModelAndView;
import web.dto.BoardDto;
import web.service.BoardService;
@Controller
//@RequestMapping("")
public class BoardController {
@Autowired
private BoardService boardService;
@GetMapping("/board/list")
public ModelAndView openBoardList() throws Exception {
//① 생성자에 값이 존재 한다면 /board/list.html 찾아간다.
ModelAndView mv = new ModelAndView("/board/list");
//② 생성자에 값이 없다면 매핑 값 '/board/list' + '.html' 찾아간다.
//ModelAndView mv = new ModelAndView();
List<BoardDto> list = boardService.selectBoardList();
mv.addObject("list", list);
return mv;
}
}
- 이전글BoardServiceImpl ( class ) 24.06.06
- 다음글list.html 24.06.06
댓글목록
등록된 댓글이 없습니다.