Created
February 10, 2014 02:22
-
-
Save jbrackett/8909321 to your computer and use it in GitHub Desktop.
HelloWorldSpring4Controller
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 com.hello.controller; | |
import org.springframework.web.bind.annotation.PathVariable; | |
import org.springframework.web.bind.annotation.RequestMapping; | |
import org.springframework.web.bind.annotation.RequestMethod; | |
import org.springframework.web.bind.annotation.RestController; | |
@RestController | |
@RequestMapping("/hello") | |
public class HelloController { | |
@RequestMapping(method = RequestMethod.GET, value = "/{name}") | |
public String sayHello(@PathVariable("name") String name) { | |
return name + " from the server"; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment