Wicket changes requestURL

I have a wicket application that can be deployed in different environments. One of these environments is the server (allows you to call it S) behind the https proxy server (allows you to call it P), so the application pages are accessed as

https://P:443/path/mountedPackage/Page?params=values 

Everything worked perfectly in the 1.4 wicket, but with the transition to the 1.5 wicket, the request URL was changed to

 http://P:443/path/mountedPackage/Page?params=values 

(https is replaced with http), which results in the "400 Bad Request" error. I do not know why this is happening, but it calls my external links to the application.

NOTE. I had the same problem before submitting the form and calling the setResponsePage(Page.class) method, and I solved it by setting another RequestTarget and manually adding "https" instead of "http" when it matches:

on gates 1.4

 component.getRequestCycle().setRequestTarget (new RedirectRequestTarget("newURLWithPropperHttps")); 

and 1.5 gates

 component.getRequestCycle().scheduleRequestHandlerAfterCurrent(new RedirectRequestHandler("newURLWithPropperHttps")); 

but now I'm not calling anyone setResponsePage() or the like, which happens when you follow a regular link from the outside.

Any help? Itโ€™s good to use the same solution as shown, but I donโ€™t know where to implement it (I tried the get() IRequestCycleProvider , but this leads me to anort error)

+4
source share
2 answers

I fixed this problem by writing my own IRequestMapper , which acts as the default, but sets the https protocol using the mapHandler() method if it should.

 final IRequestMapper o=getRootRequestMapper(); setRootRequestMapper(new IRequestMapper() { [...] @Override public Url mapHandler(IRequestHandler r) { Url u=o.mapHandler(r); if (condition) u.setProtocol("https"); return u; } }); 
+1
source

All Articles