서버 설정






Servers 생성 확인


web-inf 폴더는 내부접근만 가능 (포워드 가능 리다이렉트 불가)
https://127.0.0.1:8085/controller/
서버 가동

http://localhost:8085/controller/

@RequestMapping
@Controller
@component
get 방식으로만 받기
@RequestMapping(value="/", method=RequestMethod.GET)
public String home() {
return "home";
}
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%@ page session="false"%>
<html>
<head>
<title>Home</title>
</head>
<body>
<form action="page1" method="get">
<input type=submit>
</form>
</body>
</html>

클라이언트 -> 서버 ->디스패쳐 -> 리퀘스트맵핑

post 방식만 받도록 설정해 놓으면
@Controller
public class HomeController {
@RequestMapping("/")
public String home() {
return "home";
}
@RequestMapping(value="/page1", method=RequestMethod.POST)
public String toPage1() {
return "page1";
}
}

'디지털 컨버전스 > Spring' 카테고리의 다른 글
| [Spring Framework] 스프링 컨테이너, 가동 순서 (0) | 2020.05.29 |
|---|---|
| [Spring Framework] (0) | 2020.05.29 |
| [Spring Framework] Spring MVC (0) | 2020.05.27 |
| [Spring Framework] Annotation (0) | 2020.05.27 |
| [Spring Framework] 설정, DL / DI , IOC (0) | 2020.05.27 |