Last active
January 6, 2017 06:41
-
-
Save enujo/98edc6d5a08d7ab7740292b7e01fbf76 to your computer and use it in GitHub Desktop.
spring mvc insert
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.tistory.luahius.web; | |
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 com.tistory.luahius.service.Board; | |
import com.tistory.luahius.service.Boardservice; | |
@Controller | |
public class BoardController { | |
@Autowired | |
private Boardservice boardService; | |
@RequestMapping(value="/board/boardAdd", method=RequestMethod.GET) | |
public String boardAdd(){ | |
return "/board/boardAdd"; | |
} | |
@RequestMapping(value="/board/boardAdd", method=RequestMethod.POST) | |
public String boardAdd(Board board){ | |
boardService.addBoard(board); | |
return "redirect:/board/boardList"; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment