apzl_leasing/src_app/com/amarsoft/aims/InitAREServletX.java
2018-06-03 22:26:41 +08:00

32 lines
988 B
Java
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

package com.amarsoft.aims;
import javax.servlet.ServletException;
import com.amarsoft.are.InitAREServlet;
import com.amarsoft.are.lang.StringX;
/**
* @author EX-YANGSONG001
* 扩展ARE启动初始化类保证在没有pafa.log.home的情况下也能运行
*/
public class InitAREServletX extends InitAREServlet {
private static final long serialVersionUID = 7367963771771558983L;
public void init() throws ServletException{
String paraHome = System.getProperty("pafa.log.home");
//如果不存在para.log.home则使用系统默认的APP_HOME替代
if(paraHome==null){
String appHome = getInitParameter("AppHome");
if ((StringX.isSpace(appHome)) || (appHome.equals(".")) || (appHome.equals("/WEB-INF"))) {
appHome = getServletContext().getRealPath("/WEB-INF");
appHome = appHome.replace(System.getProperty("file.separator").charAt(0), '/');
}
paraHome = appHome+"/log";
System.setProperty("pafa.log.home", paraHome);
}
super.init();
}
}