title: What is the right way to get Page object via Sling Model annotation
body: <p>I have a property with the path to required page in a content file</p>
  
  <pre><code>...
  &lt;some_block
      ...
      sling:resourceType="some_path_to_some_component"
      somePage="some_path_to_page"
      .../&gt;
  ...
  </code></pre>
  
  <p>suitable HTL component <strong>some-component.html</strong></p>
  
  <pre><code>&lt;div data-sly-use.some_model="org.example.SomeModel"&gt;
      ...    
  &lt;/div&gt;
  </code></pre>
  
  <p>and model class <strong>SomeModel.java</strong></p>
  
  <pre><code>package org.example;
  ...
  import com.day.cq.wcm.api.Page;
  ...
  
  @Model(adaptables = { SlingHttpServletRequest.class, Resource.class },
      defaultInjectionStrategy = DefaultInjectionStrategy.REQUIRED)
  public class RelatedContentBlock {
  
      @ValueMapValue
      private Page somePage;
  
      ...
  }
  </code></pre>
  
  <p>I easily can get the required Page object using <a href="http://docs.oracle.com/javaee/6/api/javax/inject/Inject.html" rel="nofollow noreferrer">@Inject</a> and <a href="https://sling.apache.org/apidocs/sling7/org/apache/sling/models/annotations/Via.html" rel="nofollow noreferrer">@Via</a> annotations, but why can't I grab it with the <a href="https://sling.apache.org/apidocs/sling8/org/apache/sling/models/annotations/injectorspecific/ValueMapValue.html" rel="nofollow noreferrer">@ValueMapValue</a> annotation? I tried to use all the possible variants including <em>via</em> attribute and so on. And yes, I can get it from the <em><a href="https://docs.adobe.com/docs/en/htl/docs/global-objects.html" rel="nofollow noreferrer">pageManager</a></em>, but what's wrong with <a href="https://sling.apache.org/apidocs/sling8/org/apache/sling/models/annotations/injectorspecific/ValueMapValue.html" rel="nofollow noreferrer">@ValueMapValue</a>?</p>
  
  <p>Thanks in advance!</p>