Last active
December 16, 2015 00:49
-
-
Save rohman/5350308 to your computer and use it in GitHub Desktop.
Ulang Spring mvc
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
/* | |
* To change this template, choose Tools | Templates | |
* and open the template in the editor. | |
*/ | |
package id.web.rohman.ulangspring.controller; | |
import id.web.rohman.ulangspringservice.model.Tamu; | |
import id.web.rohman.ulangspringservice.service.api.TamuService; | |
import org.springframework.beans.factory.annotation.Autowired; | |
import org.springframework.stereotype.Controller; | |
import org.springframework.ui.ModelMap; | |
import org.springframework.web.bind.annotation.RequestMapping; | |
import org.springframework.web.bind.annotation.RequestParam; | |
/** | |
* | |
* @author syahril | |
*/ | |
@Controller | |
public class TamuController { | |
@Autowired | |
private TamuService tamuService; | |
@RequestMapping("/tamu/list") | |
public ModelMap list() | |
{ | |
ModelMap data = new ModelMap(); | |
data.addAttribute("tamuList", tamuService.listTamu()); | |
return data; | |
} | |
@RequestMapping("/tamu/view") | |
public ModelMap view(@RequestParam(value="id") Integer id) | |
{ | |
Tamu t = tamuService.findTamuById(id); | |
ModelMap data = new ModelMap(); | |
data.addAttribute("detailTamu", t); | |
return data; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment