Spring 팝업 띄우기
조회수 2428회
안녕하세요.
스프링으로 개발은 처음이라 많이 미숙합니다.
video 태그를 클릭 했을 때 팝업 새 창이 뜨게 하고싶습니다.
video 태그에 자바스크립트로 클릭 이벤트를 넣었고 클릭하면 새 창이 뜨긴 뜹니다만 팝업 페이지를 찾지 못하고 있습니다.
제 예상으로는 경로 문제인것 같은데 window.open의 "/daily/ListPopup" 이걸 아무리 바꿔도 원하는대로 뜨지 않습니다.
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@ page session="false" %>
<html>
<head>
<title>Home</title>
<script src="https://code.jquery.com/jquery-3.4.1.min.js"></script> <!-- jquery -->
</head>
<body>
<video id="videoPlay" width="100%" height="100%" controls autoplay muted onclick="nwindow()"></video>
<script>
function nwindow(){
window.open("/daily/ListPopup", "_blank", "toolbar=ues, menubar=yes, width=700, height=500").focus();
}
</script>
</body>
</html>
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
@Controller
@RequestMapping("/daily/*")
public class PopupController {
@RequestMapping(value="/ListPopup", method=RequestMethod.GET)
public void popupGet(Model model) throws Exception {
System.out.println("Popup");
}
}
트리도 남겨놓습니다.
오류는 "요청된 리소스 [/daily/ListPopup]은(는) 가용하지 않습니다."가 뜨거나 "페이지를 찾을 수 없습니다."가 뜹니다.
댓글 입력