You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
lvyuou/BootApplication.java

42 lines
1.4 KiB

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

package com.spring;
import net.jntoo.util.AppUtil;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.web.servlet.ServletRegistrationBean;
import org.springframework.context.ConfigurableApplicationContext;
import org.springframework.context.annotation.Bean;
import org.springframework.web.servlet.DispatcherServlet;
import tk.mybatis.spring.annotation.MapperScan;
/**
* application 启动类也就是传说中的spring boot 启动类了
*/
@SpringBootApplication
@MapperScan(basePackages = { "com.spring.dao" }) // mapper 扫描一下这个包
public class BootApplication {
static public ConfigurableApplicationContext content = null;
public static void main(String[] args) {
content = SpringApplication.run(BootApplication.class, args);
//content.getBean(DataSource.class);
System.out.println("["+BootApplication.class.getPackage().getName()+"]");
AppUtil.bootstrap(BootApplication.class.getPackage().getName()+".util");
}
/**
* 设置匹配.do后缀的请求
* @param dispatcherServlet
* @return
*/
/*
@Bean
public ServletRegistrationBean servletRegistrationBean(DispatcherServlet dispatcherServlet) {
ServletRegistrationBean bean = new ServletRegistrationBean(dispatcherServlet);
bean.addUrlMappings("*.do");
return bean;
}
*/
}