Spring Pop-up Floating

Asked 2 years ago, Updated 2 years ago, 48 views

Hello.

It's my first time developing a spring, so I'm very inexperienced.

I want a new pop-up window to appear when I click the video tag.

I put a click event in the video tag with JavaScript, and a new window appears when I click, but I can't find the pop-up page.

I think it's a path problem, but no matter how many times I change window.open's "/daily/ListPopup," it doesn't show up as I want.

<%@ 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");
    }
}

Leave a tree, too.

The error is "The requested resource [/daily/ListPopup] is not available.Page " pops up or " not found." appears.

spring

2022-09-20 16:00

1 Answers

I'm not sure if this is right, but a pop-up page appears.

@RequestMapping(value="/daily/ListPopup", method=RequestMethod.GET)
    public ModelAndView popupGet(Model model) throws Exception {
        ModelAndView mav = new ModelAndView();
        mav.setViewName("ListPopup");
        System.out.println("Popup1");

        return mav;
    }


2022-09-20 16:00

If you have any answers or tips


© 2024 OneMinuteCode. All rights reserved.