You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@wicket.apache.org by Peter Henderson <pe...@starjar.com> on 2017/05/23 12:46:04 UTC
Websocket redirect wrong url
Hi all.
I'm seeing a strange redirect problem which leads to a 404
Scenario.
1) User is on fat bookmarkable page [1]
2) Ajax onClick redirects to non bookmarkable SendMessagePage
3) SendMessage page uses websockets + background threads.
4) SendMessage page receives a websocket push event which it responds to
with [2] or [3]
When redirecting back to a really simple DummyPage all is fine.
When redirecting back to the fat bookmarkable page I get a 404 on url
https://local.starjar.com:25000/Starjar/protected/wicket/35883
Both DummyPage and PurchaseOrderPage are mounted the same way.
What am I doing which is causing the incorrect redirect path?
I'm (still) trying to build a quick start that reproduces this problem.
Further testing.
I created a new class called Dummy2 which is identical to
PurchaseOrderPage. Just a different name and mount point.
Redirecting to Dummy2 works fine .
It looks like Dummy2 => Dummy2 and PurchaseOrderPage => PurchaseOrderPage
both fail with the incorrect relative url.
Many thanks
Peter.
[1]
https://local.starjar.com:25000/Starjar/protected/purchaseOrder/35883
[2]
// This works as expected
// https://local.starjar.com:25000/Starjar/protected/dummy/12334
val pageCls = classOf[DummyDetailPage]
val pp = new PageParameters()
pp.set(WicketStarjarApplication.DetailPageIdParameterName, 12334)
throw new RestartResponseException(pageCls, pp)
[3]
// This does not work 404
// https://local.starjar.com:25000/Starjar/protected/wicket/35883
val pageCls = classOf[PurchaseOrderDetailPage]
val pp = new PageParameters()
pp.set(WicketStarjarApplication.DetailPageIdParameterName, businessId.pk)
throw new RestartResponseException(pageCls, pp)
--
Peter Henderson
Re: Websocket redirect wrong url
Posted by Martin Grigorov <mg...@apache.org>.
On Wed, May 24, 2017 at 12:18 PM, Peter Henderson <
peter.henderson@starjar.com> wrote:
> On 24 May 2017 at 11:05, Peter Henderson <pe...@starjar.com>
> wrote:
>
> >
> >
> > On 23 May 2017 at 22:24, Martin Grigorov <mg...@apache.org> wrote:
> >
> >> Hi,
> >>
> >> I'm afraid a quickstart would be needed to be able to tell what goes
> wrong
> >> there.
> >>
> >
> > Thanks for looking, I thought you'd say that.
> > Attached is a quick (ish) start.
> >
> > browse to
> > https://localhost:<port>/redirect/protected/path/pageA/112233
> > Press the button *boom*
> >
> > Removing the WebSocketBehavior on BasePage makes the page work
> > (Although in a real app I need this behavior)
> >
> > Would it be helpful if I created this on github?
> >
>
>
>
>
> Sorry for the noise.
>
> I've just tried this on Wicket 7.7 and it seems to be fixed already.
> WICKET-6342
>
Sorry for the breakage!
That was indeed a silly mistake!
>
> I don't know what's more embarrassing. Posting a dumb bug report or
> spending days trying to narrow down the bug.
> Now to upgrade my main app *fingers crossed*
>
>
> --
> Peter Henderson
>
Re: Websocket redirect wrong url
Posted by Peter Henderson <pe...@starjar.com>.
On 24 May 2017 at 11:05, Peter Henderson <pe...@starjar.com>
wrote:
>
>
> On 23 May 2017 at 22:24, Martin Grigorov <mg...@apache.org> wrote:
>
>> Hi,
>>
>> I'm afraid a quickstart would be needed to be able to tell what goes wrong
>> there.
>>
>
> Thanks for looking, I thought you'd say that.
> Attached is a quick (ish) start.
>
> browse to
> https://localhost:<port>/redirect/protected/path/pageA/112233
> Press the button *boom*
>
> Removing the WebSocketBehavior on BasePage makes the page work
> (Although in a real app I need this behavior)
>
> Would it be helpful if I created this on github?
>
Sorry for the noise.
I've just tried this on Wicket 7.7 and it seems to be fixed already.
WICKET-6342
I don't know what's more embarrassing. Posting a dumb bug report or
spending days trying to narrow down the bug.
Now to upgrade my main app *fingers crossed*
--
Peter Henderson
Re: Websocket redirect wrong url
Posted by Peter Henderson <pe...@starjar.com>.
On 23 May 2017 at 22:24, Martin Grigorov <mg...@apache.org> wrote:
> Hi,
>
> I'm afraid a quickstart would be needed to be able to tell what goes wrong
> there.
>
Thanks for looking, I thought you'd say that.
Attached is a quick (ish) start.
browse to
https://localhost:<port>/redirect/protected/path/pageA/112233
Press the button *boom*
Removing the WebSocketBehavior on BasePage makes the page work
(Although in a real app I need this behavior)
Would it be helpful if I created this on github?
>
> The appearance of /wicket/ in the url looks like either BookmarkableMapper
> (responsible for urls like /wicket/bookmarkable/com.example.Page) or
> PageInstanceMapper (responsible for urls like /wicket/page?123) is used
> instead of MountedMapper (used when the page path is configured with
> WebApplication#mountPage(String, Class) method).
>
> Martin Grigorov
> Wicket Training and Consulting
> https://twitter.com/mtgrigorov
>
> On Tue, May 23, 2017 at 2:46 PM, Peter Henderson <
> peter.henderson@starjar.com> wrote:
>
> > Hi all.
> >
> >
> > I'm seeing a strange redirect problem which leads to a 404
> >
> >
> > Scenario.
> > 1) User is on fat bookmarkable page [1]
> > 2) Ajax onClick redirects to non bookmarkable SendMessagePage
> > 3) SendMessage page uses websockets + background threads.
> > 4) SendMessage page receives a websocket push event which it responds to
> > with [2] or [3]
> >
> > When redirecting back to a really simple DummyPage all is fine.
> > When redirecting back to the fat bookmarkable page I get a 404 on url
> > https://local.starjar.com:25000/Starjar/protected/wicket/35883
> >
> > Both DummyPage and PurchaseOrderPage are mounted the same way.
> >
> >
> >
> > What am I doing which is causing the incorrect redirect path?
> >
> >
> > I'm (still) trying to build a quick start that reproduces this problem.
> >
> >
> > Further testing.
> >
> > I created a new class called Dummy2 which is identical to
> > PurchaseOrderPage. Just a different name and mount point.
> > Redirecting to Dummy2 works fine .
> >
> > It looks like Dummy2 => Dummy2 and PurchaseOrderPage => PurchaseOrderPage
> > both fail with the incorrect relative url.
> >
> >
> >
> >
> > Many thanks
> >
> > Peter.
> >
> >
> >
> >
> >
> > [1]
> > https://local.starjar.com:25000/Starjar/protected/purchaseOrder/35883
> >
> > [2]
> > // This works as expected
> > // https://local.starjar.com:25000/Starjar/protected/dummy/12334
> > val pageCls = classOf[DummyDetailPage]
> > val pp = new PageParameters()
> > pp.set(WicketStarjarApplication.DetailPageIdParameterName, 12334)
> > throw new RestartResponseException(pageCls, pp)
> >
> >
> > [3]
> > // This does not work 404
> > // https://local.starjar.com:25000/Starjar/protected/wicket/35883
> > val pageCls = classOf[PurchaseOrderDetailPage]
> > val pp = new PageParameters()
> > pp.set(WicketStarjarApplication.DetailPageIdParameterName,
> businessId.pk)
> > throw new RestartResponseException(pageCls, pp)
> >
> >
> >
> > --
> > Peter Henderson
> >
>
--
Peter Henderson
Director
Starjar Ltd.
www.starjar.com
0330 088 1662
Re: Websocket redirect wrong url
Posted by Martin Grigorov <mg...@apache.org>.
Hi,
I'm afraid a quickstart would be needed to be able to tell what goes wrong
there.
The appearance of /wicket/ in the url looks like either BookmarkableMapper
(responsible for urls like /wicket/bookmarkable/com.example.Page) or
PageInstanceMapper (responsible for urls like /wicket/page?123) is used
instead of MountedMapper (used when the page path is configured with
WebApplication#mountPage(String, Class) method).
Martin Grigorov
Wicket Training and Consulting
https://twitter.com/mtgrigorov
On Tue, May 23, 2017 at 2:46 PM, Peter Henderson <
peter.henderson@starjar.com> wrote:
> Hi all.
>
>
> I'm seeing a strange redirect problem which leads to a 404
>
>
> Scenario.
> 1) User is on fat bookmarkable page [1]
> 2) Ajax onClick redirects to non bookmarkable SendMessagePage
> 3) SendMessage page uses websockets + background threads.
> 4) SendMessage page receives a websocket push event which it responds to
> with [2] or [3]
>
> When redirecting back to a really simple DummyPage all is fine.
> When redirecting back to the fat bookmarkable page I get a 404 on url
> https://local.starjar.com:25000/Starjar/protected/wicket/35883
>
> Both DummyPage and PurchaseOrderPage are mounted the same way.
>
>
>
> What am I doing which is causing the incorrect redirect path?
>
>
> I'm (still) trying to build a quick start that reproduces this problem.
>
>
> Further testing.
>
> I created a new class called Dummy2 which is identical to
> PurchaseOrderPage. Just a different name and mount point.
> Redirecting to Dummy2 works fine .
>
> It looks like Dummy2 => Dummy2 and PurchaseOrderPage => PurchaseOrderPage
> both fail with the incorrect relative url.
>
>
>
>
> Many thanks
>
> Peter.
>
>
>
>
>
> [1]
> https://local.starjar.com:25000/Starjar/protected/purchaseOrder/35883
>
> [2]
> // This works as expected
> // https://local.starjar.com:25000/Starjar/protected/dummy/12334
> val pageCls = classOf[DummyDetailPage]
> val pp = new PageParameters()
> pp.set(WicketStarjarApplication.DetailPageIdParameterName, 12334)
> throw new RestartResponseException(pageCls, pp)
>
>
> [3]
> // This does not work 404
> // https://local.starjar.com:25000/Starjar/protected/wicket/35883
> val pageCls = classOf[PurchaseOrderDetailPage]
> val pp = new PageParameters()
> pp.set(WicketStarjarApplication.DetailPageIdParameterName, businessId.pk)
> throw new RestartResponseException(pageCls, pp)
>
>
>
> --
> Peter Henderson
>