title: Mounted mapper with named parameters also receives requests for image
body: <p>In my application I mount following URL:</p>
  
  <pre><code>this.mountPage("/details/${site}", MerchantDetailPage.class);
  </code></pre>
  
  <p>So a request to for instance ../details/anything will create an instance of MerchantDetailPage with pageparameter: site=anything.</p>
  
  <p>The constructor of MerchantDetailPage:</p>
  
  <pre><code>public MerchantDetail(final PageParameters parameters) {
      super();
  
      org.apache.wicket.util.string.StringValue storeParameter = parameters.get("site");
      if (!storeParameter.isEmpty()) {
          this.store = this.service.getStoreByQBonSiteWithCategoriesDescriptionsRegionAndAddress(storeParameter.toString());
      }
  
      if (store == null) {
          throw new RestartResponseAtInterceptPageException(Application.get().getHomePage());
      }
  
      // Build the page
      this.createPage(this.store, null);
  }
  </code></pre>
  
  <p>This seemed to work fine until I noticed that the constructor was called 4 times.
  After some digging I found that the constructor was called once with parameter site=anything but then another 3 times for 3 images that are on the page; e.g.:</p>
  
  <pre><code>&lt;img wicket:id="store_no_image" src="./images/shop_no_logo_big.png" alt="logo" /&gt;
  </code></pre>
  
  <p>So, for this resource Wicket is also calling this page but with parameter: site=images.</p>
  
  <p>As a consequence, the store is <code>null</code> so the request for the image is redirected to the homepage => the image is not found.</p>
  
  <p>Why is this happening? Why is wicket trying to treat a resource request through a page mount?</p>
  
  <p>Some side comments:</p>
  
  <ul>
  <li>MerchantDetailPage has also another constructor which is called directly from the code and accepts the store id as a parameter. In this case the problem does not occur.</li>
  <li>if I use an absolute URL for the image it does work (does not enter into MerchantDetailPage for the image request)</li>
  </ul>