package cn.bl;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.web.servlet.ServletComponentScan;
@SpringBootApplication
@ServletComponentScan
public class App {
public static voID main(String[] args) {
SpringApplication.run(App.class,args);
}
}
package cn.bl.Listener;
import javax.servlet.ServletContextEvent;
import javax.servlet.servletcontextlistener;
import javax.servlet.annotation.WebListener;
@WebListener
public class FirstListener implements servletcontextlistener{
@OverrIDe
public voID contextinitialized(ServletContextEvent sce) {
System.out.println("init .. ");
}
@OverrIDe
public voID contextDestroyed(ServletContextEvent sce) {
System.out.println("desroyed .. ");
}
}
package cn.bl.Listener;
import javax.servlet.ServletContextEvent;
import javax.servlet.servletcontextlistener;
public class SecondListener implements servletcontextlistener{
@OverrIDe
public voID contextinitialized(ServletContextEvent sce) {
System.out.println("second servletListener init .. ");
}
@OverrIDe
public voID contextDestroyed(ServletContextEvent sce) {
System.out.println("second servletListener destroy .. ");
}
}
package cn.bl;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.web.servlet.ServletListenerRegistrationBean;
import org.springframework.context.annotation.Bean;
import cn.bl.Listener.SecondListener;
@SpringBootApplication
public class App2 {
public static voID main(String[] args) {
SpringApplication.run(App2.class,args);
}
@Bean
public ServletListenerRegistrationBean
ServletListenerRegistrationBean
return bean;
}
}
以上是内存溢出为你收集整理的2018最新麦子学院Laravel框架实战开发微信商城视共30课(包含源码)全部内容,希望文章能够帮你解决2018最新麦子学院Laravel框架实战开发微信商城视共30课(包含源码)所遇到的程序开发问题。
如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)