Example usage for org.springframework.boot WebApplicationType SERVLET

List of usage examples for org.springframework.boot WebApplicationType SERVLET

Introduction

In this page you can find the example usage for org.springframework.boot WebApplicationType SERVLET.

Prototype

WebApplicationType SERVLET

To view the source code for org.springframework.boot WebApplicationType SERVLET.

Click Source Link

Document

The application should run as a servlet-based web application and should start an embedded servlet web server.

Usage

From source file:com.erudika.scoold.ScooldServer.java

public static void main(String[] args) {
    ((ch.qos.logback.classic.Logger) logger).setLevel(ch.qos.logback.classic.Level.TRACE);
    SpringApplication app = new SpringApplication(ScooldServer.class);
    initConfig();//from   w  w w  .j a va  2  s  .  c  o m
    app.setAdditionalProfiles(Config.ENVIRONMENT);
    app.setWebApplicationType(WebApplicationType.SERVLET);
    app.run(args);
}

From source file:com.erudika.scoold.ScooldServer.java

@Override
protected SpringApplicationBuilder configure(SpringApplicationBuilder app) {
    initConfig();/*w w  w.j  a va  2 s .  c o  m*/
    app.profiles(Config.ENVIRONMENT);
    app.web(WebApplicationType.SERVLET);
    return app.sources(ScooldServer.class);
}