Example usage for org.springframework.web.bind.annotation RequestMethod GET

List of usage examples for org.springframework.web.bind.annotation RequestMethod GET

Introduction

In this page you can find the example usage for org.springframework.web.bind.annotation RequestMethod GET.

Prototype

RequestMethod GET

To view the source code for org.springframework.web.bind.annotation RequestMethod GET.

Click Source Link

Usage

From source file:com.mycompany.proyecto2.ll.af.ControladorDirecciones.java

@RequestMapping(value = "/direccion", method = RequestMethod.GET, headers = { "Accept=Applicaction/json" })
public @ResponseBody String todos() throws Exception {
    DAODireccion di = new DAODireccion();

    return di.obtenerTodos();
}

From source file:com.mycompany.dvdmvc.controllers.HomeController.java

@RequestMapping(value = "/", method = RequestMethod.GET)
public String home(Map model) {
    List<DVD> dvds = dao.getDvds();
    model.put("dvds", dvds);
    model.put("DVD", new DVD());

    return "home";
}

From source file:javamalloooo.ControladorCliente.java

@RequestMapping(value = "/cliente/{nombre}/{email}/{paterno}", method = RequestMethod.GET, headers = {
        "Accept=text/html" })
@ResponseBody//www .java2  s.c om
String guardar(@PathVariable String nombre, @PathVariable String email, @PathVariable String paterno)
        throws Exception {
    Cliente c = new Cliente();
    c.setEmail(email);
    c.setNombre(nombre);
    c.setPaterno(paterno);
    DAOCliente d = new DAOCliente();
    d.guardar(c);
    return "Registro guardado";
}

From source file:com.expressflow.test.controller.ParserTestController1.java

@RequestMapping(value = "/", method = RequestMethod.GET)
public String testParser1() {
    Document doc = null;/*from   ww w.j  a va2  s. com*/
    try {
        Parser parser = new Parser("someFakeId");
        doc = new SAXBuilder().build("testresources/test1.xml");
        Element root = doc.getRootElement();
        List<?> rootInfo = root.getChildren();
        Iterator<?> iterator = rootInfo.iterator();
        while (iterator.hasNext())
            parser.executingParse((Element) iterator.next());

    } catch (Exception e) {
        log.warning(e.getMessage());
    }
    String message = "Parsed successfully!\n";
    if (doc != null)
        message += doc.toString();
    else
        message = "Parsing failed!";
    return message;
}

From source file:com.miserablemind.butter.apps.butterApp.controller.home.HomeController.java

/**
 * Handles GET request for "/"./*from   w  w  w . java2  s . c om*/
 *
 * @return logical view name
 */
@RequestMapping(method = RequestMethod.GET)
public String handleGet() {
    return "home/home";
}

From source file:com.zte.gu.webtools.web.download.DownloadController.java

@RequestMapping(method = RequestMethod.GET)
public void download(HttpSession session, HttpServletResponse response) {
    String filePath = (String) session.getAttribute("filePath");
    String fileName = (String) session.getAttribute("fileName");
    if (filePath != null) {
        response.reset();//from   ww  w .  ja v a  2s  .c o  m
        response.setHeader("Content-Disposition", "attachment; filename=" + fileName);
        response.setContentType("application/octet-stream; charset=UTF-8");
        InputStream in = null;
        try {
            in = new FileInputStream(filePath);
            IOUtils.copy(in, response.getOutputStream());
        } catch (Exception e) {
            LoggerFactory.getLogger(DownloadController.class).warn("download error,", e);
        } finally {
            IOUtils.closeQuietly(in);
            session.removeAttribute("filePath");
            session.removeAttribute("fileName");
        }
    }
}

From source file:controller.GuestController.java

@RequestMapping(value = "/guestmanager", method = RequestMethod.GET)
public String guestManager(HttpServletRequest request) {
    User user = new GeneralUser();
    if (user.checkSession(request.getSession())) {
        request.setAttribute("mssv", new Student().getMSSV());
        request.setAttribute("makhach", new Guest().getMaKhach());
        request.setAttribute("listGuest", new Guest().getListKhach());
        return "quanlykhach";
    } else {//  w  ww. j  av a2  s . c  om
        request.setAttribute("message", "Vui lng ng nhp!!");
        return "dangnhap";
    }
}

From source file:controller.ResultaatController.java

@RequestMapping(method = RequestMethod.GET)
public String doGet(@RequestParam("leerlingId") int id, Model model) {

    Leerling l = klasManager.getLeerling(id);
    model.addAttribute("leerling", l);
    return "resultaatView";
}

From source file:com.leapfrog.lfaeventmanager.admin.controller.LoginController.java

@RequestMapping(value = "login", method = RequestMethod.GET)
public ModelAndView displayLogin() {
    ModelAndView mv = new ModelAndView("login/login");
    mv.addObject("userList", userService.getAll());
    return mv;/*from ww  w  .j  av a 2s  .  c om*/
}

From source file:com.tsg.addressbookmvc.HomeController.java

@RequestMapping(value = "/rest", method = RequestMethod.GET)
public String displayRestPage() {
    return "restadd";

}