Note that there are some explanatory texts on larger screens.

plurals
  1. POWicket - Apache URL rewrite Access-Control-Allow-Origin issue
    primarykey
    data
    text
    <p>I'm facing a strange issue. I'm on UserPage on <a href="http://account.dev.pippo.com/account/UserPage" rel="nofollow">http://account.dev.pippo.com/account/UserPage</a> in this page I have a DropDown component to filter a listview (using Ajax). When choosing a value from the dropdown the XMLHttpRequest is done against <a href="http://dev.pippo.com" rel="nofollow">http://dev.pippo.com</a> instead of <a href="http://account.dev.pippo.com/account" rel="nofollow">http://account.dev.pippo.com/account</a>. This leads to an Access-Control-Allow-Origin problem:</p> <pre><code>XMLHttpRequest cannot load https://dev.pippo.com/wicket/page?3-1.IBehaviorListener.0-c…ontentList-layout-contentRight-overview-dateRange-listViewDateRangeOptions. Origin https://account.dev.pippo.com is not allowed by Access-Control-Allow-Origin. </code></pre> <p>I have an Apache rewrite rule that prepend the account. URL when /account is used.</p> <p>The /account URL is mounted using:</p> <pre><code>mountPackage("/account", UserPage.class); </code></pre> <p>(I moved all panels and custom components used by this Page on the same package)</p> <p>Should't wicket use the current URL (<a href="http://account.dev.pippo.com" rel="nofollow">http://account.dev.pippo.com</a>) as target for the Ajax request (to avoid browser blocking the requests)?</p> <p>Why is this happening? Is this a wicket bug? </p> <p>I'm using Apache Wicket 6.9.1.</p> <p>Thanks a lot.</p> <p>EDIT: In the markup file I have the following AJAX request</p> <pre><code>Wicket.Ajax.ajax({"u":"../wicket/page?3-1.IBehaviorListener.0-content-contentList-layout-contentRight-overview-dateRange-listViewDateRangeOptions","e":"change","c":"listViewDateRangeOptions13","ad":true,"m":"POST"});; </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload