use of org.apache.wicket.core.request.handler.RequestSettingRequestHandler in project wicket by apache.
the class CryptoMapperTest method additionalParameters.
/**
* Additional parameters, WICKET-4923
*/
@Test
public void additionalParameters() {
MockPage page = new MockPage();
IRequestableComponent c = page.get("foo:bar");
PageAndComponentProvider provider = new PageAndComponentProvider(page, c);
IRequestHandler handler = new ListenerRequestHandler(provider);
Url url = mapper.mapHandler(handler);
url.addQueryParameter("q", "foo");
Request request = getRequest(url);
IRequestHandler requestHandler = mapper.mapRequest(request);
assertThat(requestHandler, instanceOf(RequestSettingRequestHandler.class));
assertEquals("foo", ((RequestSettingRequestHandler) requestHandler).getRequest().getUrl().getQueryParameterValue("q").toString());
}
use of org.apache.wicket.core.request.handler.RequestSettingRequestHandler in project wicket by apache.
the class CryptoMapper method mapRequest.
@Override
public IRequestHandler mapRequest(final Request request) {
Url url = decryptUrl(request, request.getUrl());
if (url == null) {
return null;
}
Request decryptedRequest = request.cloneWithUrl(url);
IRequestHandler handler = wrappedMapper.mapRequest(decryptedRequest);
if (handler != null) {
handler = new RequestSettingRequestHandler(decryptedRequest, handler);
}
return handler;
}
Aggregations