package br.localcar.controllers;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import br.localcar.daos.ClienteDAO;
import br.localcar.models.Cadastro;
@Controller
public class CadastroController {
@Autowired
private ClienteDAO clienteDAO;
@RequestMapping("/clientes/cadastro")
public String cadastro() {
return "clientes/cadastro";
}
@RequestMapping("/clientes")
public String gravar(Cadastro cadastro) {
System.out.println(cadastro);
clienteDAO.gravar(cadastro);
return "clientes/cadastrado";
}
}