title: How to access themeDisplay Object in liferay 6.2 GA1
body: <p>I need to get ThemeDisplay object so that I can access page URL in my controller.
  I am trying with the following code but it gives null-pointer exception </p>
  
  <pre><code>@RenderMapping
  public String showItems(ModelMap model, RenderResponse response, RenderRequest request)       
  {
     ThemeDisplay themeDisplay = (ThemeDisplay)request.getAttribute(WebKeys.THEME_DISPLAY);
     Layout layout = themeDisplay.getLayout();
     String uri = layout.getFriendlyURL();
     return "home";
  }
  </code></pre>
  
  <p>I have tried printing request attribute for WebKeys.THEME_DISPLAY but it is null in my request .</p>
  
  <p>I have added following dependency in my pom.xml </p>
  
  <pre><code>&lt;dependency&gt;
    &lt;groupId&gt;com.liferay.portal&lt;/groupId&gt;
    &lt;artifactId&gt;portal-service&lt;/artifactId&gt;
    &lt;version&gt;6.1.2&lt;/version&gt;
  &lt;/dependency&gt;
  </code></pre>
  
  <p>Thanks.</p>