Example usage for org.apache.wicket Application getRootRequestMapper

List of usage examples for org.apache.wicket Application getRootRequestMapper

Introduction

In this page you can find the example usage for org.apache.wicket Application getRootRequestMapper.

Prototype

public final IRequestMapper getRootRequestMapper() 

Source Link

Usage

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  ww  w. j a  v  a2s. co  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 a2s . 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(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/*  w w  w .j a va2  s .co  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./*from   ww  w  . ja  v  a2  s .  com*/
 *
 * @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);
                    }
                }
            });
}