Created
December 16, 2017 16:51
-
-
Save skmangalam/f1732155d3ad58e08d9821cf0b589200 to your computer and use it in GitHub Desktop.
Spring MVC Hello World
This file contains hidden or 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
package online.javaguru; | |
import org.springframework.stereotype.Controller; | |
import org.springframework.web.bind.annotation.RequestMapping; | |
import org.springframework.web.servlet.ModelAndView; | |
@Controller | |
public class MyController { | |
@RequestMapping("/hello") | |
public ModelAndView helloController() { | |
ModelAndView model = new ModelAndView(); | |
model.addObject("msg","Welcome to Spring MVC"); | |
model.setViewName("welcome"); | |
return model; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment