Wicket - Apache URL rewrite Access-Control-Allow-Origin issue

2013-09-26 Thread Sergio Paganoni
Hi Everybody,

I'm facing a strange issue. I'm on UserPage on
http://account.dev.pippo.com/account/UserPage 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
http://dev.pippo.cominstead of
http://account.dev.pippo.com/account. This leads to an
Access-Control-Allow-Origin problem:

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.

I have an Apache rewrite rule that prepend the account. URL when /account
is used.

The /account URL is mounted using:

mountPackage(/account, UserPage.class);

(I moved all panels and custom components used by this UserPage on the same
package)

Should't wicket use the current URL (http://account.dev.pippo.com/account/)
as target for the Ajax request (to avoid browser blocking the requests)?

In the markup file I have the following AJAX request
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});;

Is this a wicket bug?

I'm using Apache Wicket 6.9.1.

Thanks a lot.

Sergio


Re: Wicket - Apache URL rewrite Access-Control-Allow-Origin issue

2013-09-27 Thread Sergio Paganoni
Hi Martin,

Thanks for the response, your workaround did the trick!

Thanks a lot, I'll wait to the official bug fix on version 7.0.0 and for
now stay with your workaround.

Bye


On Thu, Sep 26, 2013 at 11:34 AM, Martin Grigorov mgrigo...@apache.orgwrote:

 Hi,


 On Thu, Sep 26, 2013 at 11:22 AM, Sergio Paganoni 
 sergio.pagan...@gmail.com
  wrote:

  Hi Everybody,
 
  I'm facing a strange issue. I'm on UserPage on
  http://account.dev.pippo.com/account/UserPage 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
  http://dev.pippo.cominstead of
  http://account.dev.pippo.com/account. This leads to an
  Access-Control-Allow-Origin problem:
 
  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.
 
  I have an Apache rewrite rule that prepend the account. URL when /account
  is used.
 
  The /account URL is mounted using:
 
  mountPackage(/account, UserPage.class);
 

 Add : mountPage(/account/UserPage, UserPage.class);
 and check the produced markup. I'd expect to see something like:


 Wicket.Ajax.ajax({u:./?3-1.IBehaviorListener.0-content-contentList-layout-contentRight-overview-dateRange-listViewDateRangeOptions,e:change,c:listViewDateRangeOptions13,ad:true,m:POST});;

 that is the url should not have wicket/page in front.

 If this fixes the problem then the issue is
 https://issues.apache.org/jira/browse/WICKET-5043


  (I moved all panels and custom components used by this UserPage on the
 same
  package)
 
  Should't wicket use the current URL (
 http://account.dev.pippo.com/account/
  )
  as target for the Ajax request (to avoid browser blocking the requests)?
 
  In the markup file I have the following AJAX request
 
 
 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});;
 
  Is this a wicket bug?
 
  I'm using Apache Wicket 6.9.1.
 
  Thanks a lot.
 
  Sergio
 



Issue with UrlPathPageParametersEncoder and %2F (/)

2014-02-27 Thread Sergio Paganoni
Hi everybody,

I'm facing an issue with *Wicket 6.9.1* , I currently mount an endpoint
(/test) the following way:

mount(new MountedMapper(/test, MyPage.class,
 new UrlPathPageParametersEncoder()));

Now if I address the page in the following way, the constructor of MyPage
is correctly called
/test/testID/
/test/testID/123
/test/testID/123/test

But as long that I have an encoded / in the URL (%2F) tomcat is returning
me an empty page (nothing called MyPage).

*For example to reproduce:*
/test/testID/123/test*%2F*
/test/testID/123/test*%2F*anything
/test/a*%2F*

Is this a known bug/issue?

I've seen in JIRA (https://issues.apache.org/jira/browse/WICKET-2125) a
similar issue for Wicket 1.4 but you weren't able to reproduce it.

Thanks for your help

Sergio


Re: Re: Issue with UrlPathPageParametersEncoder and %2F (/)

2014-03-19 Thread Sergio Paganoni
Hi Sven,


Thanks for your reply, it seems like the problem is exactly the one you
reported.


Have a nice day