81,092
社区成员
发帖
与我相关
我的任务
分享
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
@RestController
@EnableAutoConfiguration
public class Application {
@RequestMapping("/")
public String home() {
return "<html><head><title>Hello World!</title></head><body><h1>Hello World!</h1><p>This is my first web site</p></body></html>";
}
public static void main(String[] args) throws Exception {
SpringApplication.run(Application.class, args);
}
}
. ____ _ __ _ _
/\\ / ___'_ __ _ _(_)_ __ __ _ \ \ \ \
( ( )\___ | '_ | '_| | '_ \/ _` | \ \ \ \
\\/ ___)| |_)| | | | | || (_| | ) ) ) )
' |____| .__|_| |_|_| |_\__, | / / / /
=========|_|==============|___/=/_/_/_/
:: Spring Boot :: (v1.4.0.RELEASE)
2016-08-20 10:54:16.103 INFO 5552 --- [ main] Application : Starting Application on DESKTOP-78CSS9B with PID 5552 (E:\workspace\javaEE\first-spring-boot\target\classes started by twx in E:\workspace\javaEE\first-spring-boot)
2016-08-20 10:54:16.107 INFO 5552 --- [ main] Application : No active profile set, falling back to default profiles: default
2016-08-20 10:54:16.140 INFO 5552 --- [ main] ationConfigEmbeddedWebApplicationContext : Refreshing org.springframework.boot.context.embedded.AnnotationConfigEmbeddedWebApplicationContext@768b970c: startup date [Sat Aug 20 10:54:16 CST 2016]; root of context hierarchy
2016-08-20 10:54:17.146 INFO 5552 --- [ main] s.b.c.e.t.TomcatEmbeddedServletContainer : Tomcat initialized with port(s): 8080 (http)
2016-08-20 10:54:17.157 INFO 5552 --- [ main] o.apache.catalina.core.StandardService : Starting service Tomcat
2016-08-20 10:54:17.158 INFO 5552 --- [ main] org.apache.catalina.core.StandardEngine : Starting Servlet Engine: Apache Tomcat/8.5.4
2016-08-20 10:54:17.231 INFO 5552 --- [ost-startStop-1] o.a.c.c.C.[Tomcat].[localhost].[/] : Initializing Spring embedded WebApplicationContext
2016-08-20 10:54:17.231 INFO 5552 --- [ost-startStop-1] o.s.web.context.ContextLoader : Root WebApplicationContext: initialization completed in 1094 ms
2016-08-20 10:54:17.267 INFO 5552 --- [ost-startStop-1] o.s.b.w.servlet.FilterRegistrationBean : Mapping filter: 'characterEncodingFilter' to: [/*]
2016-08-20 10:54:17.541 INFO 5552 --- [ main] o.s.j.e.a.AnnotationMBeanExporter : Registering beans for JMX exposure on startup
2016-08-20 10:54:17.595 INFO 5552 --- [ main] s.b.c.e.t.TomcatEmbeddedServletContainer : Tomcat started on port(s): 8080 (http)
2016-08-20 10:54:17.600 INFO 5552 --- [ main] Application : Started Application in 1.716 seconds (JVM running for 2.031)