return HttpResponses.forwardToView(securityRealm, "/jenkins/install/SetupWizard/setupWizardFirstUser.jelly"); } finally { if (admin != null) {
/** * Serves HTML reports. */ public void doDynamic(StaplerRequest req, StaplerResponse rsp) throws IOException, ServletException { DirectoryBrowserSupport dbs = new DirectoryBrowserSupport(this, new FilePath(this.dir()), this.getTitle(), "graph.gif", false); if (req.getRestOfPath().equals("")) { throw HttpResponses.forwardToView(this, "index.jelly"); } dbs.generateResponse(req, rsp, this); }
/** * Performs the actual upload. * * @param req the request. * @return the response. * @throws ServletException if something goes wrong. * @throws IOException if something goes wrong. */ @NonNull public HttpResponse doUpload(@NonNull StaplerRequest req) throws ServletException, IOException { FileItem file = req.getFileItem("certificate.file"); if (file == null) { throw new ServletException("no file upload"); } // Here is the trick, if we have a successful upload we replace ourselves in the stapler view // with an instance that has the uploaded content and request stapler to render the "complete" // view for that instance. The "complete" view can then do the injection and close itself so that // the user experience is the pop-up then click upload and finally we inject back in the content to // the form. SecretBytes uploadedKeystore = SecretBytes.fromBytes(file.get()); return HttpResponses.forwardToView( new Upload(getDivId(), uploadedKeystore), "complete"); } }
/** * Performs the actual upload. * * @param req the request. * @return the response. * @throws ServletException if something goes wrong. * @throws IOException if something goes wrong. */ @NonNull public HttpResponse doUpload(@NonNull StaplerRequest req) throws ServletException, IOException { FileItem file = req.getFileItem("certificate.file"); if (file == null) { throw new ServletException("no file upload"); } // Here is the trick, if we have a successful upload we replace ourselves in the stapler view // with an instance that has the uploaded content and request stapler to render the "complete" // view for that instance. The "complete" view can then do the injection and close itself so that // the user experience is the pop-up then click upload and finally we inject back in the content to // the form. SecretBytes uploadedKeystore = SecretBytes.fromBytes(file.get()); return HttpResponses.forwardToView( new Upload(getDivId(), uploadedKeystore), "complete"); } }