JSP/MVC
INPUT
GAWON
2023. 6. 9. 18:03
<%@ page language="java" contentType="text/html; charset=UTF-8"
pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Insert title here</title>
<script type="text/javascript">
/*
jsp에서 controller(서블릿) 호출 (요청)
1./프로젝트명/서블릿명 (비추천)
2./프로젝트명/URL매핑명
*/
function req_date(){
location.href='/chapter16_mvc/Controller1'; // /프로젝트명/URL매핑명(이동경로)
}
function req_time(){
location.href='/chapter16_mvc/Controller2'; // /프로젝트명/URL매핑명(이동경로)
}
</script>
</head>
<body>
<div>
<h1>원하는 정보의 버튼을 클릭하시오.</h1>
<button onclick="req_date()">현재 날짜 확인</button>
<button onclick="req_time()">현재 시간 확인</button>
</div>
</body>
</html>