摘要: 1、配置来至bean.xml @RunWith(SpringJUnit4ClassRunner.class) @ContextConfiguration(locations = "classpath:bean.xml") //表示在编译完成后在类路径下的beean.xml文件 public clas 阅读全文
posted @ 2020-03-31 00:28 ☆♂安♀★ 阅读(3501) 评论(0) 推荐(0) 编辑
摘要: 因为在Test里面使用了注解@Autowired 引入来至bean.xml文件的内容 ,而在Test没有没有办法自动引入,需要在Test类上加上注解 @ContextConfiguration(locations = "classpath:bean.xml")不然会报以下错误 Caught exce 阅读全文
posted @ 2020-03-30 18:52 ☆♂安♀★ 阅读(6268) 评论(0) 推荐(0) 编辑
摘要: 问题:maven执行package命令打包时,src/main/java路径下的properties文件偶尔丢失 解决方式:pom.xml中加入resources配置 <build> <resources> <resource> <directory>src/main/java</directory 阅读全文
posted @ 2020-03-21 02:15 ☆♂安♀★ 阅读(904) 评论(0) 推荐(0) 编辑
摘要: 找到work\Catalina\localhost\ 然后访问响应的JSP地址才会动态生成到这个路径下面,不访问不会生成,在org\apache\jsp 下面 阅读全文
posted @ 2020-03-17 02:01 ☆♂安♀★ 阅读(1759) 评论(5) 推荐(0) 编辑
摘要: /* * 注解类 * */ @Retention(RetentionPolicy.RUNTIME) @Target(ElementType.METHOD) public @interface Demo04Check { } /**要执行的小明定义的计算器类 * @author :cza * @dat 阅读全文
posted @ 2020-03-10 17:22 ☆♂安♀★ 阅读(664) 评论(0) 推荐(0) 编辑
摘要: public static void main(String[] args) throws IOException, NoSuchMethodException, InvocationTargetException, IllegalAccessException, InstantiationExce 阅读全文
posted @ 2020-03-10 03:18 ☆♂安♀★ 阅读(576) 评论(0) 推荐(0) 编辑
摘要: 反射类,获取类的构造函数 public class Demo01Person { public String getName() { return name; } public Demo01Person(String name, Integer age) { this.name = name; th 阅读全文
posted @ 2020-03-10 02:50 ☆♂安♀★ 阅读(2013) 评论(0) 推荐(0) 编辑
摘要: 方法1: 在pom.xml 里面加上maven打包的配置 在cmd命令 里面打开运行 , 命令是: java -server -Xms20M -Xmx50M -jar Jar包地址(默认在方案下面的target目录下) 方法2,用idea进行打包, File->Project Stricture I 阅读全文
posted @ 2019-09-10 18:56 ☆♂安♀★ 阅读(2350) 评论(0) 推荐(0) 编辑
摘要: 在resources 新建application.properties 分开在resources 新建的多个环境的文件 #测试环境 applicaion-test.properties #开发环境 application-dev.properties #生产环境 application-prod.p 阅读全文
posted @ 2019-08-29 10:58 ☆♂安♀★ 阅读(763) 评论(0) 推荐(0) 编辑