处理国际化文件频繁加载导致java.net.SocketException: Too many open files的问题
This commit is contained in:
@@ -125,21 +125,7 @@ public class SpecificServiceHostCfgController extends BaseController {
|
||||
@RequiresPermissions("specific:serviceIp:edit")
|
||||
@RequestMapping(value = "import/template")
|
||||
public String importFileTemplate(HttpServletRequest request,HttpServletResponse response, RedirectAttributes redirectAttributes) {
|
||||
Properties msgProp = new Properties();
|
||||
try {
|
||||
String language = LocaleContextHolder.getLocale().getLanguage();
|
||||
if(language.equals("zh_cn")||language.equals("zh")){
|
||||
msgProp.load(Configurations.class.getResourceAsStream("/messages/message_zh_CN.properties"));
|
||||
}else if(language.equals("ru")){
|
||||
msgProp.load(Configurations.class.getResourceAsStream("/messages/message_ru.properties"));
|
||||
}else{
|
||||
msgProp.load(Configurations.class.getResourceAsStream("/messages/message_en.properties"));
|
||||
}
|
||||
|
||||
} catch (Exception e) {
|
||||
msgProp = null;
|
||||
System.err.println("未知i18n消息配置文件,请确定文件是否存在!");
|
||||
}
|
||||
Properties msgProp = getMsgProp();
|
||||
try {
|
||||
String fileName = msgProp.getProperty("agreement_ip_configuration").replaceAll(" ", "_")+".xlsx";
|
||||
List<SpecificServiceHostCfg> list = Lists.newArrayList();
|
||||
|
||||
Reference in New Issue
Block a user