2013-06-01 03:26:30 +08:00
|
|
|
/*
|
2019-04-04 07:13:00 +08:00
|
|
|
* Copyright 2012-2019 the original author or authors.
|
2013-06-01 03:26:30 +08:00
|
|
|
*
|
|
|
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
|
|
* you may not use this file except in compliance with the License.
|
|
|
|
* You may obtain a copy of the License at
|
|
|
|
*
|
2019-03-20 22:54:00 +08:00
|
|
|
* https://www.apache.org/licenses/LICENSE-2.0
|
2013-06-01 03:26:30 +08:00
|
|
|
*
|
|
|
|
* Unless required by applicable law or agreed to in writing, software
|
|
|
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
|
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
|
|
* See the License for the specific language governing permissions and
|
|
|
|
* limitations under the License.
|
|
|
|
*/
|
|
|
|
|
2019-06-26 01:11:56 +08:00
|
|
|
package smoketest.xml;
|
2013-04-24 17:02:07 +08:00
|
|
|
|
2017-05-16 09:21:34 +08:00
|
|
|
import java.util.Collections;
|
|
|
|
|
2019-06-26 01:11:56 +08:00
|
|
|
import smoketest.xml.service.HelloWorldService;
|
2015-10-20 03:23:14 +08:00
|
|
|
|
2013-04-24 17:02:07 +08:00
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
2013-07-27 05:10:38 +08:00
|
|
|
import org.springframework.boot.CommandLineRunner;
|
|
|
|
import org.springframework.boot.SpringApplication;
|
2019-12-04 10:09:28 +08:00
|
|
|
import org.springframework.boot.autoconfigure.SpringBootApplication;
|
2014-01-22 06:37:18 +08:00
|
|
|
|
2019-12-04 10:09:28 +08:00
|
|
|
@SpringBootApplication
|
2013-07-06 07:44:24 +08:00
|
|
|
public class SampleSpringXmlApplication implements CommandLineRunner {
|
2013-04-24 17:02:07 +08:00
|
|
|
|
2017-05-16 09:21:34 +08:00
|
|
|
private static final String CONTEXT_XML = "classpath:/META-INF/application-context.xml";
|
|
|
|
|
2013-04-24 17:02:07 +08:00
|
|
|
@Autowired
|
|
|
|
private HelloWorldService helloWorldService;
|
|
|
|
|
|
|
|
@Override
|
|
|
|
public void run(String... args) {
|
|
|
|
System.out.println(this.helloWorldService.getHelloMessage());
|
|
|
|
}
|
|
|
|
|
2018-01-25 19:38:55 +08:00
|
|
|
public static void main(String[] args) {
|
2017-05-16 09:21:34 +08:00
|
|
|
SpringApplication application = new SpringApplication();
|
|
|
|
application.setSources(Collections.singleton(CONTEXT_XML));
|
|
|
|
application.run(args);
|
2013-04-24 17:02:07 +08:00
|
|
|
}
|
2015-06-23 15:47:12 +08:00
|
|
|
|
2013-04-24 17:02:07 +08:00
|
|
|
}
|