Notice
Recent Posts
Recent Comments
Link
«   2024/06   »
1
2 3 4 5 6 7 8
9 10 11 12 13 14 15
16 17 18 19 20 21 22
23 24 25 26 27 28 29
30
Tags
more
Archives
Today
Total
관리 메뉴

WON.dev

INPUT 본문

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>

'JSP > MVC' 카테고리의 다른 글

OUTPUT  (0) 2023.06.09
Today  (0) 2023.06.09
Now  (0) 2023.06.09
Controller2  (0) 2023.06.09
Controller1  (0) 2023.06.09