不重启服务器重新加载Spring上下文
来源:互联网 发布:php表单提交数据过滤 编辑:程序博客网 时间:2024/06/05 09:14
有时候服务器不方便重启,但是项目又需要更新,所以可以采取如下方法来重新加载Spring项目的Context
//注入ConfigurableWebApplicationContext@Resource ConfigurableWebApplicationContext wac;
在方法中调用
wac.refresh();
完整代码
import javax.annotation.Resource;import org.springframework.stereotype.Controller;import org.springframework.web.bind.annotation.RequestMapping;import org.springframework.web.context.ConfigurableWebApplicationContext; @Controller@RequestMapping("/test")public class TestController { @Resource ConfigurableWebApplicationContext wac; @RequestMapping("reload") public void url(){ wac.refresh(); }}
阅读全文
2 0
- 不重启服务器重新加载Spring上下文
- spring 如何加载上下文
- Spring 重新加载数据源
- 加载Spring上下文环境ApplicationContextAware
- ApplicationContextAware加载Spring上下文环境
- 加载spring上下文 工具类
- spring bean重新加载问题解决
- 通过ApplicationContextAware加载Spring上下文环境
- 通过ApplicationContextAware加载Spring上下文环境
- 通过ApplicationContextAware加载Spring上下文环境
- 加载spring上下文几种方式汇总
- 通过ApplicationContextAware加载Spring上下文环境
- 通过ApplicationContextAware加载Spring上下文环境
- 通过ApplicationContextAware加载Spring上下文环境
- 线程上下文类加载器与服务器类加载原理
- nginx重新加载配置(不停服务器)
- Spring加载上下文几种方式(Spring配置XML)
- Spring加载上下文几种方式(Spring配置XML)
- 简单工厂模式
- Yet Another Number Sequence CodeForces
- MapReduce---连接操作--Reduce端连接
- 树的子结构
- POJ2533最长上升子序列
- 不重启服务器重新加载Spring上下文
- JS怎么取后台获取的值
- 做开发8年多了,未来还要做什么
- 动态规划(爬楼梯问题)
- C++--算法
- MySQL索引类型总结和使用技巧以及注意事项
- java(android)中的for(int a:s)的用法
- Udacity Deep Learning课程作业(二)
- 动态规划之基本概念