title: Using the non-static method getUI().getPage() return an error : IllegalArgumentException
body: <p>I've a basic question. 
  I'm using Vaadin 8. </p>
  
  <p>When I use : </p>
  
  <pre><code>Page.getCurrent().setTitle(IStringConstants.HOMEPAGE_LABEL);
  </code></pre>
  
  <p>This is working without issue. </p>
  
  <p>And, when I use</p>
  
  <pre><code> getUI().getPage().setTitle(IStringConstants.HOMEPAGE_LABEL);
  </code></pre>
  
  <p>I receive an error :<code>java.lang.IllegalArgumentException: Unable to create an instance of {0}. The constructor threw an exception.</code></p>
  
  <p>Because <code>getUI()</code> return <code>null</code>. </p>
  
  <p>My code is pretty simple, in my home page : </p>
  
  <pre><code>public class HomepageView extends CustomComponent implements View {
   public HomepageView() {
      getUI().getPage().setTitle(IStringConstants.HOMEPAGE_LABEL);
      VerticalLayout layout = new VerticalLayout();
      layout.setSizeFull();
      setCompositionRoot(layout);
   }
  }
  </code></pre>
  
  <p>And my UI is : </p>
  
  <pre><code>@Theme("mytheme")
  public class myUI extends UI {
      private static final long serialVersionUID = 1L;
      private Navigator navigator;
  
      @Override
      protected void init(VaadinRequest vaadinRequest) {
          navigator = new Navigator(this, this);
          navigator.addView("", HomepageView.class);
      }
  
      @WebServlet(urlPatterns = "/*", name = "myUIServlet", asyncSupported = true)
      @VaadinServletConfiguration(ui = myUI.class, productionMode = false)
      public static class myUIServlet extends VaadinServlet {
  
          private static final long serialVersionUID = 1L;
      }
  }
  </code></pre>