/**
* 初始化系统参数
* 创建者 科帮网
* 创建时间 2017年5月10日
*
*/
public class InitServlet extends HttpServlet {
private static final long serialVersionUID = 1L;
@Override
public void init(){
try {
if(Constants.PAY_URL.size()==0){
List<CommonEntity> listPayUrl = PropertiesListUtil.listPayUrl();
for(CommonEntity entity:listPayUrl){
Constants.PAY_URL.put(entity.getEntityCode(), entity.getEntityName());
}
}
LogUtil.info("佛祖保佑 永不宕机 永无BUG :初始化系统数据数量:"+Constants.PAY_URL.size());
Configs.init("zfbinfo.properties");
LogUtil.info("初始化支付宝配置信息");
SDKConfig.getConfig().loadPropertiesFromSrc();
LogUtil.info("初始化银联支付配置信息");
} catch (Exception e) {
e.printStackTrace();
}
}
/**
* 重新加载配置文件
* @Author 科帮网
* @param request
* @param response
* @throws ServletException
* @throws IOException
* @Date 2017年5月10日
* 更新日志
* 2017年5月10日 张志朋 首次创建
*
*/
@Override
public void doGet(HttpServletRequest request, HttpServletResponse response)
throws ServletException, IOException {
Constants.PAY_URL = new ConcurrentHashMap<String, String>();
List<CommonEntity> listPayUrl = PropertiesListUtil.listPayUrl();
for(CommonEntity entity:listPayUrl){
Constants.PAY_URL.put(entity.getEntityCode(), entity.getEntityName());
}
LogUtil.info("初始化系统数据数量:"+Constants.PAY_URL.size());
}
@Override
public void doPost(HttpServletRequest request, HttpServletResponse response)
throws ServletException, IOException {
doGet(request, response);
}
}
<!-- 初始基础化数据-->
<servlet>
<servlet-name>InitServlet</servlet-name>
<servlet-class>com.acts.web.common.servlet.InitServlet</servlet-class>
<load-on-startup>1</load-on-startup>
</servlet>
<servlet-mapping>
<servlet-name>InitServlet</servlet-name>
<url-pattern>/InitServlet</url-pattern>
</servlet-mapping>
If the value is a negative integer, or the element is not present, the container is free to load the servlet whenever it chooses. If the value is a positive integer or 0, the container must load and initialize the servlet as the application is deployed.
机械节能产品生产企业官网模板...
大气智能家居家具装修装饰类企业通用网站模板...
礼品公司网站模板
宽屏简约大气婚纱摄影影楼模板...
蓝白WAP手机综合医院类整站源码(独立后台)...苏ICP备2024110244号-2 苏公网安备32050702011978号 增值电信业务经营许可证编号:苏B2-20251499 | Copyright 2018 - 2025 源码网商城 (www.ymwmall.com) 版权所有