docs: public static HttpResponseException applyResponse(final String script) {
          return new HttpResponseException() {
              public void generateResponse(StaplerRequest req, StaplerResponse rsp, Object node) throws IOException, ServletException {
                  rsp.setContentType("text/html;charset=UTF-8");
                  rsp.getWriter().println("<html><body><script>" +
                          "window.applyCompletionHandler = function (w) {" +
                          "  with(w) {" +
                          script +
                          "  }" +
                          "};" +
                          "</script></body></html>");
              }
          };
      }