Skip to content

Instantly share code, notes, and snippets.

@enujo
Last active January 6, 2017 06:41
Show Gist options
  • Save enujo/98edc6d5a08d7ab7740292b7e01fbf76 to your computer and use it in GitHub Desktop.
Save enujo/98edc6d5a08d7ab7740292b7e01fbf76 to your computer and use it in GitHub Desktop.
spring mvc insert
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