<view-controller path="/register/add" view-name="registerForm"/>
@GetMapping("/register/add")
public String register() {
return "registerForm";
}
맵핑될 URL의 공통 부분을 @RequestMapping으로 클래스에 적용한다.
Mapping URL이 같아도 GET, POST 메소드가 다르면 충돌나지 않는다.
?는 한 글자, *은 여러 글자, **은 하위 경로 포함. 배열로 여러 패턴 지정
종류 | URL pattern | 매칭 URL |
---|---|---|
1. exact mapping (정확히 일치) | /login/hello.do | https://localhost/ch2/login/hello.do |
2. path mapping (경로 맵핑) | /login/* | https://localhost/ch2/login/ https://localhost/ch2/login/hello https://localhost/ch2/login/hello.do https://localhost/ch2/login/test/ |
3. extension mapping (확장자 맵핑) | *.do | https://localhost/ch2/login/hello.do https://localhost/ch2/hi.do |
URL에 포함된 non-ASCII 문자를 문자코드(16진수) 문자열로 변환
문자열 ↔ 문자코드(숫자)