Example usage for org.apache.wicket.protocol.https Scheme HTTP

List of usage examples for org.apache.wicket.protocol.https Scheme HTTP

Introduction

In this page you can find the example usage for org.apache.wicket.protocol.https Scheme HTTP.

Prototype

Scheme HTTP

To view the source code for org.apache.wicket.protocol.https Scheme HTTP.

Click Source Link

Document

http

Usage

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 w  w .j  a v a2s . 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:de.alpharogroup.wicket.base.util.url.WicketUrlExtensions.java

License:Apache License

/**
 * Gets the domain url./* www.j a v  a  2s.c  o  m*/
 * 
 * @param ssl
 *            if the domain url is secure the scheme https will be added otherwise http
 * @param withServerPort
 *            the with server port
 * @param withSlashAtTheEnd
 *            the with slash at the end
 * @return the domain url
 */
public static String getDomainUrl(final boolean ssl, final boolean withServerPort,
        final boolean withSlashAtTheEnd) {
    return newDomainUrl(ssl ? Scheme.HTTPS.urlName() : Scheme.HTTP.urlName(),
            WicketUrlExtensions.getServerName(),
            WicketComponentExtensions.getHttpServletRequest().getServerPort(), withServerPort,
            withSlashAtTheEnd);
}

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  w  w  w .  j  a va2 s .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(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.url.WicketUrlUtils.java

License:Apache License

/**
 * Gets the domain url./*from  w  ww .ja  v a2 s . c o m*/
 * 
 * @param ssl
 *            if the domain url is secure the scheme https will be added otherwise http
 * @param withServerPort
 *            the with server port
 * @param withSlashAtTheEnd
 *            the with slash at the end
 * @return the domain url
 */
public static String getDomainUrl(boolean ssl, boolean withServerPort, boolean withSlashAtTheEnd) {
    return newDomainUrl(ssl ? Scheme.HTTPS.urlName() : Scheme.HTTP.urlName(), WicketUrlUtils.getServerName(),
            WicketComponentUtils.getHttpServletRequest().getServerPort(), withServerPort, withSlashAtTheEnd);
}