Search code examples
javaspringjspspring-annotations

Java Spring Annotations Open Multiple Views in multiple tabs simultainiously


I have a controller in the form of:

@Controller
public class fooController{
    @RequestMapping(value = "/foo.htm", method = RequestMethod.POST)
    public String processForm(HttpServletRequest request,
        HttpServletResponse response)
        return "view1";
}

Where "view1" maps to a jsp file. What I need though, is to somehow return 3 seperate views that would occupy 3 seperate tabs in the browser. Basically the user clicks submit, and then three tabs pop up.

How could I accomplish this in Spring (w/ annotations)?


Solution

  • You can't. Only the browser gets to decide to open multiple windows, and it does that using javascript.

    Your controller can return a page containing javascript that then opens multiple windows, or you can use AJAX-style javascript to invoke the original request and then trigger the windows that way. Either way, the server has no knowledge or control of it.