2018最新麦子学院Laravel框架实战开发微信商城视共30课(包含源码)

前端之家收集整理的这篇文章主要介绍了2018最新麦子学院Laravel框架实战开发微信商城视共30课(包含源码)前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。

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 ServletListenerRegistrationBeangetBean(){


        ServletListenerRegistrationBeanbean = new ServletListenerRegistrationBean<>(new SecondListener());


        return bean;


    }


}


猜你在找的Laravel相关文章