当前位置: 首页 > news >正文

怎么在电脑上做网站国外常用的seo站长工具

怎么在电脑上做网站,国外常用的seo站长工具,如何建设好政府门户网站,WordPress室内净化主题在Spring容器加入一个实现了BeanPostProcessor接口bean实例,重写postProcessBeforeInitialization、postProcessAfterInitialization方法,在方法里面写具体的实现,从而达到Spring容器在初如化前或销毁时执行预定的程序,方法如下&a…

在Spring容器加入一个实现了BeanPostProcessor接口bean实例,重写postProcessBeforeInitialization、postProcessAfterInitialization方法,在方法里面写具体的实现,从而达到Spring容器在初如化前或销毁时执行预定的程序,方法如下:

1、pop.xml导包
 

<dependency><groupId>org.springframework</groupId><artifactId>spring-context</artifactId><version>5.3.37</version>
</dependency>
<dependency>

2、写一个类实现BeanPostProcessor接口,同时写一个User实体类用于测试
实现类:

package test.spring.model;import org.springframework.beans.BeansException;
import org.springframework.beans.factory.config.BeanPostProcessor;public class LifeBeanAware implements BeanPostProcessor {@Overridepublic Object postProcessBeforeInitialization(Object bean, String beanName) throws BeansException {// TODO Auto-generated method stubSystem.out.println("前置处理");return null;}@Overridepublic Object postProcessAfterInitialization(Object bean, String beanName) throws BeansException {// TODO Auto-generated method stubSystem.out.println("后置处理");return null;}}

User类:

/**
*Description:
*author: ljd
*@date 2024年7月2日 
*@version 1.0 
*/
package test.spring.model;public class User {private int id;private String name;public int getId() {return id;}public void setId(int id) {System.out.println("user赋值");this.id = id;}public String getName() {return name;}public void setName(String name) {this.name = name;}public void testPrint() {System.out.println("this is test init function");}@Overridepublic String toString() {return "User [id=" + id + ", name=" + name + "]";}public User() {super();}}

3、applicationContext.xml配置

<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd"><bean id="user1" init-method="testPrint" destroy-method="testPrint" class="test.spring.model.User" ><property name="id" value="1"></property><property name="name" value="zs"></property></bean><bean class="test.spring.model.LifeBeanAware"></bean>
</beans>


4、测试结果

/**
*Description:
*author: ljd
*@date 2024年7月2日 
*@version 1.0 
*/
package testSpring;import org.junit.Test;
import org.springframework.context.ConfigurableApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;import test.spring.model.User;public class TestSpring {@Testpublic void testUser() {ConfigurableApplicationContext ac=new ClassPathXmlApplicationContext("applicationContext.xml");User user=ac.getBean(User.class); System.out.println(user);ac.close();}}

http://www.dinnco.com/news/40599.html

相关文章:

  • 毕业设计做一个网站怎么做网络营销个人感悟小结
  • 网站网站建设网页设计seo推广教学
  • 周口网站建设.comseo方法
  • 某种网站怎么找seo搜索方法
  • 外贸五金网站建设外贸网站推广平台
  • 企业每月报账在哪个网站做十大seo公司
  • 99到家微网站什么做的ping站长工具
  • 无锡网站设计服务手机怎么搭建属于自己的网站
  • 买医疗产品的网站建设seo资源网站排名
  • 台州电子商务网站开发社群营销的案例
  • 长沙seo管理宁波seo教学
  • 个人如何制作一个网站深圳网络推广服务是什么
  • 响应式科技公司网站模板下载app推广拉新
  • 网页游戏sf平台成都百度seo推广
  • 代码素材网站哪个好重庆网站优化软件
  • wordpress百度云网盘seo专业培训课程
  • 兰州网站运营诊断万能优化大师下载
  • 专业做胶粘剂招聘网站枸橼酸西地那非片的功效与作用
  • 江苏网站建设seo发包排名软件
  • wordpress网校插件搜索引擎优化的方式有哪些
  • 教育培训网站建设方案seo是什么的
  • 一个网站怎么做新闻模块市场调研报告范文3000字
  • wordpress 4.4.2优化公司排名
  • 网站页头页尾怎样做深圳推广不动产可视化查询
  • 网站建设合同标的怎么写网站建设流程步骤
  • 郑州做花店网站营销的方法和技巧
  • 举报网站建设新闻今天的最新新闻
  • 网站集约化建设的优势淘宝新店怎么快速做起来
  • 长沙网站排名公司哪家好免费二级域名注册申请
  • 国外室内设计案例网站做网站优化的公司