Skip to content

Instantly share code, notes, and snippets.

@AntonioDiaz
Created November 28, 2016 09:25
Show Gist options
  • Save AntonioDiaz/8f059c347ed60d595cd47bcb8294123d to your computer and use it in GitHub Desktop.
Save AntonioDiaz/8f059c347ed60d595cd47bcb8294123d to your computer and use it in GitHub Desktop.
minimun Spring MVC controller
package com;
import org.springframework.stereotype.Controller;
import org.springframework.ui.ModelMap;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
@Controller
public class MyController {
@RequestMapping(value="/helloWeb", method=RequestMethod.GET)
public String wellcomePage(ModelMap modelMap) {
modelMap.addAttribute("message", "Spring 3 MVC Hello World");
return "hello";
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment