title: Jenkins Plugin. RootAction. index.jelly in seperate window
body: <p>i am writing a simple plugin and am forced to create a RootAction which displays a page (the index.jelly) and needs some additional values to confirm and then execute the methode.</p>
  
  <p>My problem is, that the index.jelly file gets always displayed on a blank window.
  But i do need it to be included inside of the Jenkinstemplate in the main table, as usual.</p>
  
  <p>Can't seem to figure out why this is happening.</p>
  
  <p>Any ideas?</p>
  
  <p>RestartJksLink.java</p>
  
  <pre><code>package org.jenkinsci.plugins.tomcat_app_restart;
  
  import hudson.Extension;
  import hudson.model.ManagementLink;
  
  /**
   *
   *
   * @author [...]
   */
  @Extension
  public class RestartJksLink extends ManagementLink {
      @Override
      public String getIconFileName() {
          return "/plugin/tomcat-app-restart/images/restart.png";
      }
  
      @Override
      public String getUrlName() {
          return "jksrestart";
      }
  
      @Override
      public String getDescription() {
         return "Restart your Jenkins-Application on Tomcat";
      }
  
      public String getDisplayName() {
          return "Restart Jenkins-App on Tomcat";
      }
  }
  </code></pre>
  
  <p>RestartJksRootAction.java</p>
  
  <pre><code>package org.jenkinsci.plugins.tomcat_app_restart;
  
  import java.io.IOException;
  import java.net.Authenticator;
  import java.net.HttpURLConnection;
  import java.net.PasswordAuthentication;
  import java.net.URL;
  
  import jenkins.model.Jenkins;
  import hudson.Extension;
  import hudson.model.RootAction;
  import hudson.util.FormValidation;
  
  @Extension
  public class RestartJksRootAction implements RootAction {
      public String getDisplayName() {
          return "Restart Jenkins on Tomcat";
      }
  
      public String getIconFileName() {
          if (!Jenkins.getInstance().hasPermission(Jenkins.ADMINISTER)) {
            return null;
          }
  
          if (!Jenkins.getInstance().getLifecycle().canRestart()) {
            return null;
          }
  
          return "/plugin/tomcat-app-restart/images/restart.png";
      }
  
      public String getUrlName() {
          return "jksrestart";
      }
  
      public FormValidation doJksRestart() {
          Authenticator.setDefault (new Authenticator() {
              protected PasswordAuthentication getPasswordAuthentication() {
                  return new PasswordAuthentication ("admin", "admin".toCharArray());
              }
          });
  
          URL url;
          try {
              url = new URL("http://localhost:8888/manager/text/start?path=/jenkins");
              HttpURLConnection connection = (HttpURLConnection)url.openConnection();
              System.out.println("" + connection.getResponseMessage());
  
              return FormValidation.ok("Success");
          } catch (IOException e) {
  
              return FormValidation.error("Client error: " + e.getMessage());
          }
      }
  }
  </code></pre>
  
  <p>index.jelly inside: resources.org.jenkinsci.plugins.tomcat_app_restart.RestartJksRootAction</p>
  
  <pre><code>&lt;j:jelly xmlns:j="jelly:core" xmlns:st="jelly:stapler" xmlns:d="jelly:define" xmlns:l="/lib/layout" xmlns:t="/lib/hudson" xmlns:f="/lib/form" xmlns:i="jelly:fmt" xmlns:p="/lib/hudson/project"&gt;
    &lt;f:validateButton
     title="${%Restart Jenkins}" progress="${%Restarting...}"
     method="JksRestart" with="" /&gt;
  &lt;/j:jelly&gt;
  </code></pre>
  
  <p>Thank you guys!</p>
  
  <p>I am new to jenkins plugin development, this would help me a lot to understand.</p>
  
  <p>Kind regards.</p>