加入收藏 | 设为首页 | 会员中心 | 我要投稿 安卓应用网 (https://www.0791zz.com/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 编程开发 > PHP > 正文

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

发布时间:2020-05-25 02:47:24 所属栏目:PHP 来源:互联网
导读:本文章向大家介绍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;


}


}


(编辑:安卓应用网)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读