Hi Alexey,

On Tue, May 28, 2013 at 11:21 AM, Alexey Mukas <[email protected]>wrote:

> Hi Martin,
>
> I've made further investigations and found the problem, it was an order of
> 'mounting pages' and 'setRootRequestMapper'.
>
> If mounting goes first everything works fine (the URL to Loging generated
> with HTTPS), but if I change the order the URL is generated for HTTP and
> there is no redirect after transition to the Login page.
>
> The source of the issue is resolving Url for IRequestHandler.
> In method RequestCycle#mapUrlFor line 429, the mapHandler is called which
> returns Url without protocol set.
> The mapHandler goes through all registered mappers, so registration order
> matters..
>
> in class CompoundRequestMapper:
>
> @Override
>         public Url mapHandler(final IRequestHandler handler)
>         {
>                 for (IRequestMapper mapper : mappers)
>                 {
>                         Url url = mapper.mapHandler(handler);
>                         if (url != null)
>                         {
>                                 return url;
>                         }
>                 }
>                 return null;
>         }
>
> I've solved my issue by changing the order, but I would like to avoid this
> in future, what would you recommend?
>

I don't have a solution for this problem :-/

The javadoc of HttpsMapper says that it should be mounted as late as needed:
https://github.com/apache/wicket/blob/master/wicket-core/src/main/java/org/apache/wicket/protocol/https/HttpsMapper.java?source=cc#L52

Mounting pages after configuring the HttpsMapper is a valid use case.


>
>
>
>
> --
> View this message in context:
> http://apache-wicket.1842946.n4.nabble.com/How-to-create-https-link-to-a-page-tp4659050p4659087.html
> Sent from the Users forum mailing list archive at Nabble.com.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [email protected]
> For additional commands, e-mail: [email protected]
>
>

Reply via email to