반응형

 

TestController

 

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
package com.myspring.pro29.ex01;
 
 
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("/test/*")
public class TestController {
 
    
    @RequestMapping(value="notice/{num}", method=RequestMethod.GET)
    public int notice(@PathVariable("num"int num) throws Exception{
        return num;
    }
    
}
 
cs

 

 

 

 실행 결과 

 

반응형

+ Recent posts