List of usage examples for org.apache.wicket Application setRootRequestMapper
public final Application setRootRequestMapper(final IRequestMapper rootRequestMapper)
From source file:de.alpharogroup.wicket.base.util.application.ApplicationExtensions.java
License:Apache License
/** * Sets the root request mapper for the given application from the given httpPort and httpsPort. * * @param application/*from w w w . j a v a2 s . c o m*/ * 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; }
From source file:de.alpharogroup.wicket.base.util.application.ApplicationExtensions.java
License:Apache License
/** * Sets the RootRequestMapper for the given application from the given httpPort and httpsPort. * Note: if the configuration type is RuntimeConfigurationType.DEVELOPMENT then only HTTP scheme * will be returned.//from w ww .j a v a 2s . c o m * * @param application * the application * @param httpPort * the http port * @param httpsPort * the https port */ public static void setRootRequestMapperForDevelopment(final Application application, final int httpPort, final int httpsPort) { application.setRootRequestMapper( new HttpsMapper(application.getRootRequestMapper(), new HttpsConfig(httpPort, httpsPort)) { @Override protected Scheme getDesiredSchemeFor(final Class<? extends IRequestablePage> pageClass) { if (application.getConfigurationType().equals(RuntimeConfigurationType.DEVELOPMENT)) { // is in development mode, returning Scheme.HTTP... return Scheme.HTTP; } else { // not in development mode, letting the mapper decide return super.getDesiredSchemeFor(pageClass); } } }); }
From source file:org.jaulp.wicket.base.util.application.ApplicationUtils.java
License:Apache License
/** * Sets the root request mapper for the given application from the given httpPort and httpsPort. * * @param application/*from w w w. j av a2 s. c o m*/ * the application * @param httpPort * the http port * @param httpsPort * the https port */ public static void setRootRequestMapper(final Application application, final int httpPort, final int httpsPort) { application.setRootRequestMapper( new HttpsMapper(application.getRootRequestMapper(), new HttpsConfig(httpPort, httpsPort))); }
From source file:org.jaulp.wicket.base.util.application.ApplicationUtils.java
License:Apache License
/** * Sets the RootRequestMapper for the given application from the given httpPort and httpsPort. * Note: if the configuration type is RuntimeConfigurationType.DEVELOPMENT then only HTTP scheme * will be returned./* w ww. j a v a 2s .c om*/ * * @param application * the application * @param httpPort * the http port * @param httpsPort * the https port */ public static void setRootRequestMapperForDevelopment(final Application application, final int httpPort, final int httpsPort) { application.setRootRequestMapper( new HttpsMapper(application.getRootRequestMapper(), new HttpsConfig(httpPort, httpsPort)) { @Override protected Scheme getDesiredSchemeFor(Class<? extends IRequestablePage> pageClass) { if (application.getConfigurationType().equals(RuntimeConfigurationType.DEVELOPMENT)) { // is in development mode, returning Scheme.HTTP... return Scheme.HTTP; } else { // not in development mode, letting the mapper decide return super.getDesiredSchemeFor(pageClass); } } }); }