main.java

来自「aop在项目中的应用」· Java 代码 · 共 20 行

JAVA
20
字号
package simon.tools.aop;

import org.springframework.context.ApplicationContext;
import org.springframework.context.support.FileSystemXmlApplicationContext;
import java.net.*;

public class Main {

  public static void main(String[] args) {
    Main main = new Main();
    String path = "/classes/simon/tools/aop/springconfig.xml";
    //Read the configuration file
    ApplicationContext ctx = new FileSystemXmlApplicationContext(path);
    //Instantiate an object
    Bean x = (Bean) ctx.getBean("bean");
    //Execute the public method of the bean (the test)
    x.theMethod("这也行啊!");
  }
}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?