setRootRequestMapper(new HttpsMapper(getRootRequestMapper(), new HttpsConfig(8080, 8443)){ @Override public Url mapHandler(IRequestHandler requestHandler) { Url url = super.mapHandler(requestHandler); if ("https".equals(url.getProtocol)){ // Force the HostName for HTTPS requests url.setHost("securepage.example.com"); } return url; } });
/** * Sets the root request mapper for the given application from the given httpPort and httpsPort. * * @param application * the application * @param httpPort * the http port * @param httpsPort * the https port * @return the i request mapper */ public static IRequestMapper setRootRequestMapper(final Application application, final int httpPort, final int httpsPort) { final IRequestMapper httpsMapper = new HttpsMapper(application.getRootRequestMapper(), new HttpsConfig(httpPort, httpsPort)); application.setRootRequestMapper(httpsMapper); return httpsMapper; }
final int httpPort, final int httpsPort) application.setRootRequestMapper(new HttpsMapper(application.getRootRequestMapper(), new HttpsConfig(httpPort, httpsPort))