Merge branch 'develop' of http://192.168.10.125/k18_web/NFS.git into develop
This commit is contained in:
@@ -25,13 +25,21 @@ public class IpPortCfg extends BaseIpCfg {
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
private static final long serialVersionUID = 4664942095843594575L;
|
private static final long serialVersionUID = 4664942095843594575L;
|
||||||
//仅用作导入时copy属性
|
//仅用作导入时copy属性使用
|
||||||
private String antiddosProtocol;
|
private String antiddosProtocol;
|
||||||
//仅用作导入时copy属性
|
//仅用作导入时copy属性使用
|
||||||
private Long bpsThreadshold;
|
private Long bpsThreadshold;
|
||||||
//仅用作导入时copy属性
|
//仅用作导入时copy属性使用
|
||||||
private Long ppsThreadshold;
|
private Long ppsThreadshold;
|
||||||
|
//仅用作导入时copy属性使用
|
||||||
|
private Integer policyGroup;
|
||||||
|
|
||||||
|
public Integer getPolicyGroup() {
|
||||||
|
return policyGroup;
|
||||||
|
}
|
||||||
|
public void setPolicyGroup(Integer policyGroup) {
|
||||||
|
this.policyGroup = policyGroup;
|
||||||
|
}
|
||||||
public String getAntiddosProtocol() {
|
public String getAntiddosProtocol() {
|
||||||
return antiddosProtocol;
|
return antiddosProtocol;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,11 @@
|
|||||||
|
package com.nis.domain.configuration.template;
|
||||||
|
|
||||||
|
import com.nis.util.excel.ExcelField;
|
||||||
|
|
||||||
|
public class SnatTemplate extends IpAllTemplate{
|
||||||
|
|
||||||
|
@ExcelField(title="group",align=2,sort=2)
|
||||||
|
private Integer policyGroup;
|
||||||
|
@ExcelField(title="isp",align=2,sort=3)
|
||||||
|
private String isp;
|
||||||
|
}
|
||||||
@@ -352,6 +352,35 @@ public class ExportExcel {
|
|||||||
commentStr=msgProp.getProperty("select")+":\n"+commentStr;
|
commentStr=msgProp.getProperty("select")+":\n"+commentStr;
|
||||||
index++;
|
index++;
|
||||||
}
|
}
|
||||||
|
if("group".equals(headerStr)) {
|
||||||
|
commentStr="";
|
||||||
|
//查询ip复用地址池配置的policyGroup列表
|
||||||
|
List<PolicyGroupInfo> list=policyGroupInfoDao.findPolicyGroupInfosByType(2);
|
||||||
|
if(!StringUtil.isEmpty(list)){
|
||||||
|
for (PolicyGroupInfo policyGroupInfo : list) {
|
||||||
|
commentStr=commentStr+policyGroupInfo.getGroupId()+"("+policyGroupInfo.getGroupName()+")\n";
|
||||||
|
index++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
commentStr=msgProp.getProperty("select")+":\n"+commentStr;
|
||||||
|
index++;
|
||||||
|
}
|
||||||
|
if("isp".equals(headerStr)) {
|
||||||
|
commentStr="";
|
||||||
|
List<Integer> itTypeList = new ArrayList<Integer>();
|
||||||
|
itTypeList.add(Constants.ITEM_TYPE_ISP);
|
||||||
|
SysDictInfo sysDictInfo=new SysDictInfo();
|
||||||
|
sysDictInfo.setConditionType(itTypeList);
|
||||||
|
List<SysDictInfo> isps=sysDictInfoDao.findAllSysDictInfo(sysDictInfo,null);
|
||||||
|
if(!StringUtil.isEmpty(isps)){
|
||||||
|
for (SysDictInfo _sysDictInfo : isps) {
|
||||||
|
commentStr=commentStr+_sysDictInfo.getItemCode()+"("+_sysDictInfo.getItemValue()+")\n";
|
||||||
|
index++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
commentStr=msgProp.getProperty("select")+":\n"+commentStr;
|
||||||
|
index++;
|
||||||
|
}
|
||||||
if(region.getRegionType().equals(1)){//IP配置
|
if(region.getRegionType().equals(1)){//IP配置
|
||||||
//ip配置需要导入的信息:srcIp srcPort destIp destPort Protocol Direction
|
//ip配置需要导入的信息:srcIp srcPort destIp destPort Protocol Direction
|
||||||
//确定需要导入的srcIp srcPort destIp destPort信息
|
//确定需要导入的srcIp srcPort destIp destPort信息
|
||||||
|
|||||||
@@ -59,6 +59,7 @@ import com.nis.domain.configuration.template.AsnIpTemplate;
|
|||||||
import com.nis.domain.configuration.template.ComplexStringAllTemplate;
|
import com.nis.domain.configuration.template.ComplexStringAllTemplate;
|
||||||
import com.nis.domain.configuration.template.DdosIpTemplate;
|
import com.nis.domain.configuration.template.DdosIpTemplate;
|
||||||
import com.nis.domain.configuration.template.DnsComplexStringTemplate;
|
import com.nis.domain.configuration.template.DnsComplexStringTemplate;
|
||||||
|
import com.nis.domain.configuration.template.DnsIpTemplate;
|
||||||
import com.nis.domain.configuration.template.IpAllTemplate;
|
import com.nis.domain.configuration.template.IpAllTemplate;
|
||||||
import com.nis.domain.configuration.template.IpCfgTemplate;
|
import com.nis.domain.configuration.template.IpCfgTemplate;
|
||||||
import com.nis.domain.configuration.template.IpPayloadTemplate;
|
import com.nis.domain.configuration.template.IpPayloadTemplate;
|
||||||
@@ -70,6 +71,7 @@ import com.nis.domain.log.BaseLogEntity;
|
|||||||
import com.nis.domain.log.SearchReport;
|
import com.nis.domain.log.SearchReport;
|
||||||
import com.nis.domain.specific.SpecificServiceCfg;
|
import com.nis.domain.specific.SpecificServiceCfg;
|
||||||
import com.nis.exceptions.MaatConvertException;
|
import com.nis.exceptions.MaatConvertException;
|
||||||
|
import com.nis.util.ConfigServiceUtil;
|
||||||
import com.nis.util.Configurations;
|
import com.nis.util.Configurations;
|
||||||
//import com.nis.main.ConvertTool;
|
//import com.nis.main.ConvertTool;
|
||||||
import com.nis.util.Constants;
|
import com.nis.util.Constants;
|
||||||
@@ -1424,6 +1426,23 @@ public class BaseController {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
// dns fake ip
|
||||||
|
if (regionDict.getFunctionId().equals(401)) {
|
||||||
|
Integer dnsStrategyId = baseIpCfg.getDnsStrategyId();
|
||||||
|
if (dnsStrategyId != null) {
|
||||||
|
if(dnsStrategyId>0) {
|
||||||
|
List<DnsResStrategy> dnsStrategys = dnsResStrategyService
|
||||||
|
.findDnsResStrategys(Long.valueOf(dnsStrategyId), Constants.VALID_YES, Constants.AUDIT_YES);
|
||||||
|
if (dnsStrategys == null || dnsStrategys.size() == 0) {
|
||||||
|
errInfo.append(
|
||||||
|
String.format(prop.getProperty("is_incorrect"), prop.getProperty("dns_res_strategy"))
|
||||||
|
+ ";");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}else {
|
||||||
|
baseIpCfg.setDnsStrategyId(0);
|
||||||
|
}
|
||||||
|
}
|
||||||
//p2p ip
|
//p2p ip
|
||||||
if (regionDict.getFunctionId().equals(510) && "p2p_ip".equals(regionDict.getConfigServiceType())) { // P2p
|
if (regionDict.getFunctionId().equals(510) && "p2p_ip".equals(regionDict.getConfigServiceType())) { // P2p
|
||||||
// IP
|
// IP
|
||||||
@@ -3189,7 +3208,13 @@ public class BaseController {
|
|||||||
List<IpAllTemplate> list = ei.getDataList(IpAllTemplate.class, this.getMsgProp(),regionDict);
|
List<IpAllTemplate> list = ei.getDataList(IpAllTemplate.class, this.getMsgProp(),regionDict);
|
||||||
ipPortCfgs = this.checkIpCfg(serviceDict, regionDict, list);
|
ipPortCfgs = this.checkIpCfg(serviceDict, regionDict, list);
|
||||||
}
|
}
|
||||||
} else if (regionDict.getFunctionId().equals(212)) {
|
} else if (regionDict.getFunctionId().equals(7)&&serviceDict!=null&&serviceDict.getAction().intValue()==16) {
|
||||||
|
List<DnsIpTemplate> list = ei.getDataList(DnsIpTemplate.class, this.getMsgProp(),regionDict);
|
||||||
|
ipPortCfgs = this.checkIpCfg(serviceDict, regionDict, list);
|
||||||
|
}else if(regionDict.getFunctionId().equals(401)) {
|
||||||
|
List<DnsIpTemplate> list = ei.getDataList(DnsIpTemplate.class, this.getMsgProp(),regionDict);
|
||||||
|
ipPortCfgs = this.checkIpCfg(serviceDict, regionDict, list);
|
||||||
|
}else if (regionDict.getFunctionId().equals(212)) {
|
||||||
List<IpPayloadTemplate> list = ei.getDataList(IpPayloadTemplate.class, this.getMsgProp(),regionDict);
|
List<IpPayloadTemplate> list = ei.getDataList(IpPayloadTemplate.class, this.getMsgProp(),regionDict);
|
||||||
ipPortCfgs = this.checkIpCfg(serviceDict, regionDict, list);
|
ipPortCfgs = this.checkIpCfg(serviceDict, regionDict, list);
|
||||||
} else if (regionDict.getFunctionId().equals(510)
|
} else if (regionDict.getFunctionId().equals(510)
|
||||||
@@ -3278,6 +3303,15 @@ public class BaseController {
|
|||||||
ipPortCfgs.clear();
|
ipPortCfgs.clear();
|
||||||
asnIpCfgService.saveAsnIpBatch(asnIpCfgs);
|
asnIpCfgService.saveAsnIpBatch(asnIpCfgs);
|
||||||
}else {
|
}else {
|
||||||
|
List<Integer> compileIds=Lists.newArrayList();
|
||||||
|
try {
|
||||||
|
compileIds = ConfigServiceUtil.getId(1,ipPortCfgs.size());
|
||||||
|
} catch (Exception e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
logger.info("获取编译ID出错");
|
||||||
|
throw new MaatConvertException("<spring:message code=\"request_service_failed\"/>:"+e.getMessage());
|
||||||
|
}
|
||||||
|
int ind=0;
|
||||||
for (BaseIpCfg cfg : ipPortCfgs) {
|
for (BaseIpCfg cfg : ipPortCfgs) {
|
||||||
cfg.setAction(serviceDict==null?null:serviceDict.getAction());
|
cfg.setAction(serviceDict==null?null:serviceDict.getAction());
|
||||||
cfg.setAuditorId(UserUtils.getUser().getId());
|
cfg.setAuditorId(UserUtils.getUser().getId());
|
||||||
@@ -3297,7 +3331,7 @@ public class BaseController {
|
|||||||
cfg.setRequestId(StringUtil.isEmpty(requestId) ? 0 : requestId);
|
cfg.setRequestId(StringUtil.isEmpty(requestId) ? 0 : requestId);
|
||||||
cfg.setServiceId(serviceDict==null?null:serviceDict.getServiceId());
|
cfg.setServiceId(serviceDict==null?null:serviceDict.getServiceId());
|
||||||
cfg.setTableName("ip_port_cfg");
|
cfg.setTableName("ip_port_cfg");
|
||||||
cfg.setCompileId(ipCfgService.getCompileId());
|
cfg.setCompileId(compileIds.get(ind));
|
||||||
if (serviceDict!=null&&(serviceDict.getServiceId().intValue() == 33
|
if (serviceDict!=null&&(serviceDict.getServiceId().intValue() == 33
|
||||||
|| serviceDict.getServiceId().intValue() == 145
|
|| serviceDict.getServiceId().intValue() == 145
|
||||||
|| serviceDict.getServiceId().intValue() == 35
|
|| serviceDict.getServiceId().intValue() == 35
|
||||||
@@ -3322,26 +3356,38 @@ public class BaseController {
|
|||||||
appPolicyCfgs.add(appPolicyCfg);
|
appPolicyCfgs.add(appPolicyCfg);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if(regionDict.getFunctionId().intValue()!=600) {
|
if(regionDict.getFunctionId().intValue()!=600
|
||||||
|
&®ionDict.getFunctionId().intValue()!=301
|
||||||
|
&®ionDict.getFunctionId().intValue()!=401) {
|
||||||
CfgIndexInfo cfgIndexInfo = new CfgIndexInfo();
|
CfgIndexInfo cfgIndexInfo = new CfgIndexInfo();
|
||||||
BeanUtils.copyProperties(cfg, cfgIndexInfo);
|
BeanUtils.copyProperties(cfg, cfgIndexInfo);
|
||||||
cfgIndexInfos.add(cfgIndexInfo);
|
cfgIndexInfos.add(cfgIndexInfo);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
ind++;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(ipPortCfgs!=null&&ipPortCfgs.size()>0) {
|
if(ipPortCfgs!=null&&ipPortCfgs.size()>0) {
|
||||||
if (regionDict.getFunctionId().equals(301)) {
|
if (regionDict.getFunctionId().equals(301)) {
|
||||||
ddosCfgService.saveDdosIpCfg(ipPortCfgs);
|
ddosCfgService.saveDdosIpCfg(ipPortCfgs);
|
||||||
|
}else if (regionDict.getFunctionId().equals(401)) {
|
||||||
|
dnsIpCfgService.saveDnsIpCfg(ipPortCfgs);
|
||||||
}else {
|
}else {
|
||||||
ipCfgService.saveBatch(ipPortCfgs, IpCfgDao.class);
|
ipCfgService.saveBatch(ipPortCfgs, IpCfgDao.class);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
} else if (regionDict.getRegionType().equals(2)) {
|
} else if (regionDict.getRegionType().equals(2)) {
|
||||||
|
List<Integer> compileIds=Lists.newArrayList();
|
||||||
|
try {
|
||||||
|
compileIds = ConfigServiceUtil.getId(1,stringCfgs.size());
|
||||||
|
} catch (Exception e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
logger.info("获取编译ID出错");
|
||||||
|
throw new MaatConvertException("<spring:message code=\"request_service_failed\"/>:"+e.getMessage());
|
||||||
|
}
|
||||||
|
int ind=0;
|
||||||
for (BaseStringCfg cfg : stringCfgs) {
|
for (BaseStringCfg cfg : stringCfgs) {
|
||||||
cfg.setAction(serviceDict.getAction());
|
cfg.setAction(serviceDict.getAction());
|
||||||
cfg.setAuditorId(UserUtils.getUser().getId());
|
cfg.setAuditorId(UserUtils.getUser().getId());
|
||||||
@@ -3360,7 +3406,7 @@ public class BaseController {
|
|||||||
cfg.setLable("0");
|
cfg.setLable("0");
|
||||||
cfg.setRequestId(StringUtil.isEmpty(requestId) ? 0 : requestId);
|
cfg.setRequestId(StringUtil.isEmpty(requestId) ? 0 : requestId);
|
||||||
cfg.setServiceId(serviceDict.getServiceId());
|
cfg.setServiceId(serviceDict.getServiceId());
|
||||||
cfg.setCompileId(ipCfgService.getCompileId());
|
cfg.setCompileId(compileIds.get(i));
|
||||||
if (serviceDict.getServiceId().intValue() == 33
|
if (serviceDict.getServiceId().intValue() == 33
|
||||||
|| serviceDict.getServiceId().intValue() == 145
|
|| serviceDict.getServiceId().intValue() == 145
|
||||||
|| serviceDict.getServiceId().intValue() == 35
|
|| serviceDict.getServiceId().intValue() == 35
|
||||||
@@ -3389,6 +3435,7 @@ public class BaseController {
|
|||||||
BeanUtils.copyProperties(cfg, cfgIndexInfo, new String[] {"cfgId"});
|
BeanUtils.copyProperties(cfg, cfgIndexInfo, new String[] {"cfgId"});
|
||||||
cfgIndexInfos.add(cfgIndexInfo);
|
cfgIndexInfos.add(cfgIndexInfo);
|
||||||
}
|
}
|
||||||
|
ind++;
|
||||||
}
|
}
|
||||||
// 调用对应配置的service
|
// 调用对应配置的service
|
||||||
if (regionDict.getDictId().intValue() == 167) {
|
if (regionDict.getDictId().intValue() == 167) {
|
||||||
@@ -3425,6 +3472,15 @@ public class BaseController {
|
|||||||
avContentCfgService.saveVoIpAccountCfg(stringCfgs);
|
avContentCfgService.saveVoIpAccountCfg(stringCfgs);
|
||||||
}
|
}
|
||||||
} else if (regionDict.getRegionType().equals(3)) {
|
} else if (regionDict.getRegionType().equals(3)) {
|
||||||
|
List<Integer> compileIds=Lists.newArrayList();
|
||||||
|
try {
|
||||||
|
compileIds = ConfigServiceUtil.getId(1,complexkeywordCfgs.size());
|
||||||
|
} catch (Exception e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
logger.info("获取编译ID出错");
|
||||||
|
throw new MaatConvertException("<spring:message code=\"request_service_failed\"/>:"+e.getMessage());
|
||||||
|
}
|
||||||
|
int ind=0;
|
||||||
for (ComplexkeywordCfg cfg : complexkeywordCfgs) {
|
for (ComplexkeywordCfg cfg : complexkeywordCfgs) {
|
||||||
cfg.setAction(serviceDict.getAction());
|
cfg.setAction(serviceDict.getAction());
|
||||||
cfg.setAuditorId(UserUtils.getUser().getId());
|
cfg.setAuditorId(UserUtils.getUser().getId());
|
||||||
@@ -3443,7 +3499,7 @@ public class BaseController {
|
|||||||
cfg.setLable("0");
|
cfg.setLable("0");
|
||||||
cfg.setRequestId(StringUtil.isEmpty(requestId) ? 0 : requestId);
|
cfg.setRequestId(StringUtil.isEmpty(requestId) ? 0 : requestId);
|
||||||
cfg.setServiceId(serviceDict.getServiceId());
|
cfg.setServiceId(serviceDict.getServiceId());
|
||||||
cfg.setCompileId(ipCfgService.getCompileId());
|
cfg.setCompileId(compileIds.get(ind));
|
||||||
if (serviceDict.getServiceId().intValue() == 33
|
if (serviceDict.getServiceId().intValue() == 33
|
||||||
|| serviceDict.getServiceId().intValue() == 145
|
|| serviceDict.getServiceId().intValue() == 145
|
||||||
|| serviceDict.getServiceId().intValue() == 35
|
|| serviceDict.getServiceId().intValue() == 35
|
||||||
@@ -3472,6 +3528,7 @@ public class BaseController {
|
|||||||
BeanUtils.copyProperties(cfg, cfgIndexInfo);
|
BeanUtils.copyProperties(cfg, cfgIndexInfo);
|
||||||
cfgIndexInfos.add(cfgIndexInfo);
|
cfgIndexInfos.add(cfgIndexInfo);
|
||||||
}
|
}
|
||||||
|
ind++;
|
||||||
}
|
}
|
||||||
if (regionDict.getDictId().intValue() == 28) {
|
if (regionDict.getDictId().intValue() == 28) {
|
||||||
websiteCfgService.saveDnsCfg(complexkeywordCfgs);
|
websiteCfgService.saveDnsCfg(complexkeywordCfgs);
|
||||||
|
|||||||
@@ -560,8 +560,8 @@ public class AvController extends BaseController {
|
|||||||
if(validateAvDuration(uploadSrcFile)){
|
if(validateAvDuration(uploadSrcFile)){
|
||||||
String shellName = Constants.VEDIO_TO_PICTURE_PROC;
|
String shellName = Constants.VEDIO_TO_PICTURE_PROC;
|
||||||
// String params = srcFileAllPath+" "+picFilePath+" 0.95 90.0 0.5";
|
// String params = srcFileAllPath+" "+picFilePath+" 0.95 90.0 0.5";
|
||||||
String params = srcFileAllPath+" "+picFilePath;
|
String[] params = new String[]{srcFileAllPath,picFilePath};
|
||||||
logger.info("调用视频转关键帧图片程序:"+shellName+" " +params);
|
logger.info("调用视频转关键帧图片程序:"+shellName+" " +StringUtils.join(params," "));
|
||||||
Map resultMap = avCfgService.execShell(shellName, params);
|
Map resultMap = avCfgService.execShell(shellName, params);
|
||||||
if(resultMap.get("exitStatus").equals(0)){//调用外部程序成功
|
if(resultMap.get("exitStatus").equals(0)){//调用外部程序成功
|
||||||
String out = resultMap.get("out").toString();//输出参数
|
String out = resultMap.get("out").toString();//输出参数
|
||||||
@@ -572,6 +572,18 @@ public class AvController extends BaseController {
|
|||||||
if(state==1){
|
if(state==1){
|
||||||
//关键帧图片生成成功,删除原视频文件
|
//关键帧图片生成成功,删除原视频文件
|
||||||
FileUtils.deleteFile(srcFileAllPath);
|
FileUtils.deleteFile(srcFileAllPath);
|
||||||
|
//获取图片列表
|
||||||
|
Collection<File> files = FileUtils.listFiles(new File(picFilePath), null, true);
|
||||||
|
String srcPath = null;
|
||||||
|
for(File f:files){
|
||||||
|
if(srcPath==null){
|
||||||
|
srcPath = f.getName();
|
||||||
|
}else{
|
||||||
|
srcPath += "|"+f.getName();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
//将图片文件列表赋值给生成样例的源文件路径参数
|
||||||
|
map.put("srcPath", srcPath);
|
||||||
map.put("status", 1);
|
map.put("status", 1);
|
||||||
map.put("msg", "success");
|
map.put("msg", "success");
|
||||||
}else{
|
}else{
|
||||||
|
|||||||
@@ -39,6 +39,7 @@ import com.nis.domain.configuration.template.IpRateLimitTemplate;
|
|||||||
import com.nis.domain.configuration.template.IpWhitelistTemplate;
|
import com.nis.domain.configuration.template.IpWhitelistTemplate;
|
||||||
import com.nis.domain.configuration.template.P2pHashStringTemplate;
|
import com.nis.domain.configuration.template.P2pHashStringTemplate;
|
||||||
import com.nis.domain.configuration.template.P2pIpTemplate;
|
import com.nis.domain.configuration.template.P2pIpTemplate;
|
||||||
|
import com.nis.domain.configuration.template.SnatTemplate;
|
||||||
import com.nis.domain.configuration.template.StringAllTemplate;
|
import com.nis.domain.configuration.template.StringAllTemplate;
|
||||||
import com.nis.domain.specific.ConfigGroupInfo;
|
import com.nis.domain.specific.ConfigGroupInfo;
|
||||||
import com.nis.exceptions.MaatConvertException;
|
import com.nis.exceptions.MaatConvertException;
|
||||||
@@ -263,7 +264,7 @@ public class IpController extends BaseController{
|
|||||||
ExportExcel excel=new ExportExcel(serviceDict,regionDict,this.getMsgProp(),null, IpPayloadTemplate.class, 2);
|
ExportExcel excel=new ExportExcel(serviceDict,regionDict,this.getMsgProp(),null, IpPayloadTemplate.class, 2);
|
||||||
excel.setDataList(this.getMsgProp(),classList,null).
|
excel.setDataList(this.getMsgProp(),classList,null).
|
||||||
write(request,response, fileName).dispose();
|
write(request,response, fileName).dispose();
|
||||||
}else if(regionDict.getFunctionId().equals(7)){ //Dns IP
|
}else if(regionDict.getFunctionId().equals(7)||regionDict.getFunctionId().equals(401)){ //Dns IP,DNS FAKE IP
|
||||||
List<DnsIpTemplate> classList=new ArrayList<DnsIpTemplate>();
|
List<DnsIpTemplate> classList=new ArrayList<DnsIpTemplate>();
|
||||||
ExportExcel excel=new ExportExcel(serviceDict,regionDict,this.getMsgProp(),null, DnsIpTemplate.class, 2);
|
ExportExcel excel=new ExportExcel(serviceDict,regionDict,this.getMsgProp(),null, DnsIpTemplate.class, 2);
|
||||||
excel.setDataList(this.getMsgProp(),classList,null).
|
excel.setDataList(this.getMsgProp(),classList,null).
|
||||||
@@ -288,6 +289,11 @@ public class IpController extends BaseController{
|
|||||||
ExportExcel excel=new ExportExcel(serviceDict,regionDict,this.getMsgProp(),null, DdosIpTemplate.class, 2);
|
ExportExcel excel=new ExportExcel(serviceDict,regionDict,this.getMsgProp(),null, DdosIpTemplate.class, 2);
|
||||||
excel.setDataList(this.getMsgProp(),classList,null).
|
excel.setDataList(this.getMsgProp(),classList,null).
|
||||||
write(request,response, fileName).dispose();
|
write(request,response, fileName).dispose();
|
||||||
|
}else if(regionDict.getFunctionId().equals(633)){ //snat ip池
|
||||||
|
List<SnatTemplate> classList=new ArrayList<SnatTemplate>();
|
||||||
|
ExportExcel excel=new ExportExcel(serviceDict,regionDict,this.getMsgProp(),null, SnatTemplate.class, 2);
|
||||||
|
excel.setDataList(this.getMsgProp(),classList,null).
|
||||||
|
write(request,response, fileName).dispose();
|
||||||
}else{
|
}else{
|
||||||
List<IpAllTemplate> classList=new ArrayList<IpAllTemplate>();
|
List<IpAllTemplate> classList=new ArrayList<IpAllTemplate>();
|
||||||
ExportExcel excel=new ExportExcel(serviceDict,regionDict,this.getMsgProp(),null, IpAllTemplate.class, 2);
|
ExportExcel excel=new ExportExcel(serviceDict,regionDict,this.getMsgProp(),null, IpAllTemplate.class, 2);
|
||||||
|
|||||||
@@ -535,7 +535,7 @@ public class AvCfgService extends BaseService{
|
|||||||
}
|
}
|
||||||
result.put("error", out.toString());//错误信息
|
result.put("error", out.toString());//错误信息
|
||||||
int waitFor = exec.waitFor();
|
int waitFor = exec.waitFor();
|
||||||
logger.info("调用脚本:"+shellName+",执行返回状态值:"+waitFor);
|
logger.info("调用脚本:"+sb.toString()+",执行返回状态值:"+waitFor);
|
||||||
result.put("exitStatus", waitFor);//执行状态
|
result.put("exitStatus", waitFor);//执行状态
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
|
|||||||
@@ -80,20 +80,26 @@ public class DdosCfgService extends BaseService{
|
|||||||
entity.setCreateTime(createTime);
|
entity.setCreateTime(createTime);
|
||||||
entity.setIsValid(0);
|
entity.setIsValid(0);
|
||||||
entity.setIsAudit(0);
|
entity.setIsAudit(0);
|
||||||
//调用服务接口获取compileId
|
if(entity.getCompileId()==null||entity.getCompileId().intValue()==0) {
|
||||||
List<Integer> compileIds = new ArrayList<Integer>();
|
//调用服务接口获取compileId
|
||||||
try {
|
List<Integer> compileIds = new ArrayList<Integer>();
|
||||||
compileIds = ConfigServiceUtil.getId(1,1);
|
try {
|
||||||
} catch (Exception e) {
|
compileIds = ConfigServiceUtil.getId(1,1);
|
||||||
e.printStackTrace();
|
} catch (Exception e) {
|
||||||
logger.info("获取编译ID出错");
|
e.printStackTrace();
|
||||||
throw new MaatConvertException(e.getMessage());
|
logger.info("获取编译ID出错");
|
||||||
|
throw new MaatConvertException(e.getMessage());
|
||||||
|
}
|
||||||
|
if(compileIds != null && compileIds.size() >0 && compileIds.get(0) != 0){
|
||||||
|
entity.setCompileId(compileIds.get(0));
|
||||||
|
}else{
|
||||||
|
throw new MaatConvertException("<spring:message code=\"request_service_failed\"/>");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
if(compileIds != null && compileIds.size() >0 && compileIds.get(0) != 0){
|
if(entity.getCompileId()!=null&&entity.getCompileId().intValue()>0) {
|
||||||
entity.setCompileId(compileIds.get(0));
|
|
||||||
ddosCfgDao.insert(entity);
|
ddosCfgDao.insert(entity);
|
||||||
}else{
|
}else {
|
||||||
throw new MaatConvertException("<spring:message code=\"request_service_failed\"/>");
|
throw new RuntimeException("Could not get compileId!");
|
||||||
}
|
}
|
||||||
|
|
||||||
//修改
|
//修改
|
||||||
|
|||||||
@@ -5,12 +5,14 @@ import java.util.ArrayList;
|
|||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
|
import org.springframework.beans.BeanUtils;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
import org.springframework.transaction.annotation.Transactional;
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
|
|
||||||
import com.nis.domain.Page;
|
import com.nis.domain.Page;
|
||||||
import com.nis.domain.callback.InlineIp;
|
import com.nis.domain.callback.InlineIp;
|
||||||
|
import com.nis.domain.configuration.BaseIpCfg;
|
||||||
import com.nis.domain.configuration.DnsIpCfg;
|
import com.nis.domain.configuration.DnsIpCfg;
|
||||||
import com.nis.domain.maat.ToMaatResult;
|
import com.nis.domain.maat.ToMaatResult;
|
||||||
import com.nis.exceptions.MaatConvertException;
|
import com.nis.exceptions.MaatConvertException;
|
||||||
@@ -43,6 +45,13 @@ public class DnsIpCfgService extends BaseService{
|
|||||||
public DnsIpCfg getDnsIpCfg(Long cfgId) {
|
public DnsIpCfg getDnsIpCfg(Long cfgId) {
|
||||||
return dnsIpCfgDao.getDnsIpCfg(cfgId);
|
return dnsIpCfgDao.getDnsIpCfg(cfgId);
|
||||||
}
|
}
|
||||||
|
public void saveDnsIpCfg(List<BaseIpCfg> cfgs) {
|
||||||
|
for(BaseIpCfg cfg:cfgs) {
|
||||||
|
DnsIpCfg _cfg=new DnsIpCfg();
|
||||||
|
BeanUtils.copyProperties(cfg, _cfg);
|
||||||
|
saveOrUpdate(_cfg);
|
||||||
|
}
|
||||||
|
}
|
||||||
@Transactional(readOnly=false,rollbackFor=RuntimeException.class)
|
@Transactional(readOnly=false,rollbackFor=RuntimeException.class)
|
||||||
public void saveOrUpdate(DnsIpCfg entity){
|
public void saveOrUpdate(DnsIpCfg entity){
|
||||||
Date createTime=new Date();
|
Date createTime=new Date();
|
||||||
@@ -54,20 +63,27 @@ public class DnsIpCfgService extends BaseService{
|
|||||||
entity.setCreateTime(createTime);
|
entity.setCreateTime(createTime);
|
||||||
entity.setIsValid(0);
|
entity.setIsValid(0);
|
||||||
entity.setIsAudit(0);
|
entity.setIsAudit(0);
|
||||||
//调用服务接口获取compileId
|
if(entity.getCompileId()==null||entity.getCompileId()==0) {
|
||||||
List<Integer> compileIds = new ArrayList<Integer>();
|
//调用服务接口获取compileId
|
||||||
try {
|
List<Integer> compileIds = new ArrayList<Integer>();
|
||||||
compileIds = ConfigServiceUtil.getId(1,1);
|
try {
|
||||||
} catch (Exception e) {
|
compileIds = ConfigServiceUtil.getId(1,1);
|
||||||
e.printStackTrace();
|
} catch (Exception e) {
|
||||||
logger.info("获取编译ID出错");
|
e.printStackTrace();
|
||||||
throw new MaatConvertException("<spring:message code=\"request_service_failed\"/>:"+e.getMessage());
|
logger.info("获取编译ID出错");
|
||||||
|
throw new MaatConvertException("<spring:message code=\"request_service_failed\"/>:"+e.getMessage());
|
||||||
|
}
|
||||||
|
if(compileIds != null && compileIds.size() >0 && compileIds.get(0) != 0){
|
||||||
|
entity.setCompileId(compileIds.get(0));
|
||||||
|
|
||||||
|
}else{
|
||||||
|
throw new MaatConvertException("<spring:message code=\"request_service_failed\"/>");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
if(compileIds != null && compileIds.size() >0 && compileIds.get(0) != 0){
|
if(entity.getCompileId()!=null&&entity.getCompileId()>0) {
|
||||||
entity.setCompileId(compileIds.get(0));
|
|
||||||
dnsIpCfgDao.insert(entity);
|
dnsIpCfgDao.insert(entity);
|
||||||
}else{
|
}else {
|
||||||
throw new MaatConvertException("<spring:message code=\"request_service_failed\"/>");
|
throw new RuntimeException("Could not get compileId!");
|
||||||
}
|
}
|
||||||
|
|
||||||
//修改
|
//修改
|
||||||
|
|||||||
@@ -20,4 +20,10 @@ UPDATE function_region_dict SET is_import=1 WHERE function_id=8 AND dict_id IN(
|
|||||||
UPDATE function_region_dict SET is_import=1 WHERE function_id=22 AND dict_id IN(25,597);
|
UPDATE function_region_dict SET is_import=1 WHERE function_id=22 AND dict_id IN(25,597);
|
||||||
#DDOS IP
|
#DDOS IP
|
||||||
UPDATE function_region_dict SET is_import=1,config_ip_port_show='3,4' WHERE function_id=301 AND dict_id IN(74);
|
UPDATE function_region_dict SET is_import=1,config_ip_port_show='3,4' WHERE function_id=301 AND dict_id IN(74);
|
||||||
UPDATE function_service_dict SET is_import=1 WHERE function_id=301;
|
UPDATE function_service_dict SET is_import=1 WHERE function_id=301;
|
||||||
|
#SNAT 导入先不做
|
||||||
|
UPDATE function_region_dict SET is_import=0,region_type=1,config_ip_port_show='3' WHERE function_id=633;
|
||||||
|
UPDATE function_service_dict SET is_import=0 WHERE function_id=633;
|
||||||
|
#DNS欺骗IP
|
||||||
|
UPDATE function_region_dict SET is_import=1 WHERE function_id=401;
|
||||||
|
UPDATE function_service_dict SET is_import=1 WHERE function_id=401;
|
||||||
@@ -69,9 +69,10 @@ $(function(){
|
|||||||
top.$.jBox.closeTip();
|
top.$.jBox.closeTip();
|
||||||
if(data.status==1){
|
if(data.status==1){
|
||||||
$("#picPath").val(data.picFilePath);
|
$("#picPath").val(data.picFilePath);
|
||||||
|
$("#srcPath").val(data.srcPath);
|
||||||
$("#showPicture").removeClass("hidden");
|
$("#showPicture").removeClass("hidden");
|
||||||
var url = "${ctx}/ntc/av/sample/selectVedioPicture?picFilePath="+encodeURIComponent(data.picFilePath);
|
var url = "${ctx}/ntc/av/sample/selectVedioPicture?picFilePath="+encodeURIComponent(data.picFilePath);
|
||||||
openPicWindow(url);
|
//openPicWindow(url);
|
||||||
}else{
|
}else{
|
||||||
alert(data.msg);
|
alert(data.msg);
|
||||||
}
|
}
|
||||||
@@ -85,7 +86,7 @@ $(function(){
|
|||||||
height:$(document).height()*0.8,
|
height:$(document).height()*0.8,
|
||||||
top: '10%',
|
top: '10%',
|
||||||
draggable:false,
|
draggable:false,
|
||||||
title: "error info", buttons:{ "close":true}
|
title: "Error Info", buttons:{ "close":true}
|
||||||
});
|
});
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -61,6 +61,23 @@
|
|||||||
onClick="javascript:window.location='${ctx}/cfg/dnsIp/form?functionId=${cfg.functionId}'">
|
onClick="javascript:window.location='${ctx}/cfg/dnsIp/form?functionId=${cfg.functionId}'">
|
||||||
<i class="fa fa-plus"></i>
|
<i class="fa fa-plus"></i>
|
||||||
<spring:message code="add"></spring:message></button>
|
<spring:message code="add"></spring:message></button>
|
||||||
|
<c:set var="serviceImport" value="false"></c:set>
|
||||||
|
<c:set var="regionImport" value="false"></c:set>
|
||||||
|
<c:forEach items="${serviceList}" var="service" >
|
||||||
|
<c:if test="${(cfg.functionId eq service.functionId) && service.isImport eq 1}">
|
||||||
|
<c:set var="serviceImport" value="true"></c:set>
|
||||||
|
</c:if>
|
||||||
|
</c:forEach>
|
||||||
|
<c:forEach items="${regionList}" var="region" >
|
||||||
|
<c:if test="${(cfg.functionId eq region.functionId) && region.isImport eq 1}">
|
||||||
|
<c:set var="regionImport" value="true"></c:set>
|
||||||
|
</c:if>
|
||||||
|
</c:forEach>
|
||||||
|
<c:if test="${serviceImport eq 'true' && regionImport eq 'true'}">
|
||||||
|
<button type="button" class="btn btn-primary import" >
|
||||||
|
<i class="fa fa-plus"></i>
|
||||||
|
<spring:message code="import"></spring:message></button>
|
||||||
|
</c:if>
|
||||||
</shiro:hasPermission>
|
</shiro:hasPermission>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
@@ -440,6 +457,8 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
<c:set var="importPath" value="/cfg/dnsIp/list?functionId=${cfg.functionId}"/>
|
||||||
|
<!-- 模板导入,start -->
|
||||||
|
<%@include file="/WEB-INF/include/excel/importModal.jsp" %>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
@@ -46,6 +46,23 @@
|
|||||||
onClick="javascript:window.location='${ctx}/maintenance/ipMultiplexPoolCfg/snatform?functionId=${cfg.functionId}'">
|
onClick="javascript:window.location='${ctx}/maintenance/ipMultiplexPoolCfg/snatform?functionId=${cfg.functionId}'">
|
||||||
<i class="fa fa-plus"></i>
|
<i class="fa fa-plus"></i>
|
||||||
<spring:message code="add"></spring:message></button>
|
<spring:message code="add"></spring:message></button>
|
||||||
|
<c:set var="serviceImport" value="false"></c:set>
|
||||||
|
<c:set var="regionImport" value="false"></c:set>
|
||||||
|
<c:forEach items="${serviceList}" var="service" >
|
||||||
|
<c:if test="${(cfg.functionId eq service.functionId) && service.isImport eq 1}">
|
||||||
|
<c:set var="serviceImport" value="true"></c:set>
|
||||||
|
</c:if>
|
||||||
|
</c:forEach>
|
||||||
|
<c:forEach items="${regionList}" var="region" >
|
||||||
|
<c:if test="${(cfg.functionId eq region.functionId) && region.isImport eq 1}">
|
||||||
|
<c:set var="regionImport" value="true"></c:set>
|
||||||
|
</c:if>
|
||||||
|
</c:forEach>
|
||||||
|
<c:if test="${serviceImport eq 'true' && regionImport eq 'true'}">
|
||||||
|
<button type="button" class="btn btn-primary import" >
|
||||||
|
<i class="fa fa-plus"></i>
|
||||||
|
<spring:message code="import"></spring:message></button>
|
||||||
|
</c:if>
|
||||||
</shiro:hasPermission>
|
</shiro:hasPermission>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
@@ -451,6 +468,8 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
<c:set var="importPath" value="/maintenance/ipMultiplexPoolCfg/snatlist?functionId=${cfg.functionId}"/>
|
||||||
|
<!-- 模板导入,start -->
|
||||||
|
<%@include file="/WEB-INF/include/excel/importModal.jsp" %>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
@@ -3,9 +3,23 @@ response.setStatus(400);
|
|||||||
|
|
||||||
// 获取异常类
|
// 获取异常类
|
||||||
Throwable ex = Exceptions.getThrowable(request);
|
Throwable ex = Exceptions.getThrowable(request);
|
||||||
|
//获取国际化信息
|
||||||
|
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;
|
||||||
|
}
|
||||||
// 编译错误信息
|
// 编译错误信息
|
||||||
StringBuilder sb = new StringBuilder("(400)<spring:message code=\"exception_info\"/>:\n");
|
StringBuilder sb = new StringBuilder("(400)"+msgProp!=null?msgProp.getProperty("exception_info"):"Exception Infomation"+":\n");
|
||||||
if (ex != null) {
|
if (ex != null) {
|
||||||
if (ex instanceof BindException) {
|
if (ex instanceof BindException) {
|
||||||
for (ObjectError e : ((BindException)ex).getGlobalErrors()){
|
for (ObjectError e : ((BindException)ex).getGlobalErrors()){
|
||||||
@@ -24,7 +38,7 @@ if (ex != null) {
|
|||||||
sb.append("☆" + ex.getMessage());
|
sb.append("☆" + ex.getMessage());
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
sb.append("<spring:message code=\"unkown_error\"/>.\n\n");
|
sb.append(msgProp!=null?msgProp.getProperty("unkown_error"):"Unkown Error Infomation"+":\n\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
// 如果是异步请求或是手机端,则直接返回信息
|
// 如果是异步请求或是手机端,则直接返回信息
|
||||||
@@ -42,6 +56,9 @@ else {
|
|||||||
<%@page import="com.nis.web.security.Servlets"%>
|
<%@page import="com.nis.web.security.Servlets"%>
|
||||||
<%@page import="com.nis.util.Exceptions"%>
|
<%@page import="com.nis.util.Exceptions"%>
|
||||||
<%@page import="com.nis.util.StringUtils"%>
|
<%@page import="com.nis.util.StringUtils"%>
|
||||||
|
<%@page import="java.util.Properties"%>
|
||||||
|
<%@page import="org.springframework.context.i18n.LocaleContextHolder"%>
|
||||||
|
<%@page import="com.nis.util.Configurations"%>
|
||||||
<%@page contentType="text/html;charset=UTF-8" isErrorPage="true"%>
|
<%@page contentType="text/html;charset=UTF-8" isErrorPage="true"%>
|
||||||
<%@include file="/WEB-INF/include/taglib.jsp"%>
|
<%@include file="/WEB-INF/include/taglib.jsp"%>
|
||||||
<!DOCTYPE html>
|
<!DOCTYPE html>
|
||||||
|
|||||||
@@ -3,13 +3,27 @@ response.setStatus(403);
|
|||||||
|
|
||||||
//获取异常类
|
//获取异常类
|
||||||
Throwable ex = Exceptions.getThrowable(request);
|
Throwable ex = Exceptions.getThrowable(request);
|
||||||
|
//获取国际化信息
|
||||||
|
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;
|
||||||
|
}
|
||||||
// 如果是异步请求或是手机端,则直接返回信息
|
// 如果是异步请求或是手机端,则直接返回信息
|
||||||
if (Servlets.isAjaxRequest(request)) {
|
if (Servlets.isAjaxRequest(request)) {
|
||||||
if (ex!=null && StringUtils.startsWith(ex.getMessage(), "msg:")){
|
if (ex!=null && StringUtils.startsWith(ex.getMessage(), "msg:")){
|
||||||
out.print(StringUtils.replace(ex.getMessage(), "msg:", ""));
|
out.print(StringUtils.replace(ex.getMessage(), "msg:", ""));
|
||||||
}else{
|
}else{
|
||||||
out.print("<spring:message code=\"no_permission\"/>.");
|
out.print(msgProp!=null?msgProp.getProperty("no_permission"):"Lack of authority");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -19,6 +33,9 @@ else {
|
|||||||
<%@page import="com.nis.web.security.Servlets"%>
|
<%@page import="com.nis.web.security.Servlets"%>
|
||||||
<%@page import="com.nis.util.Exceptions"%>
|
<%@page import="com.nis.util.Exceptions"%>
|
||||||
<%@page import="com.nis.util.StringUtils"%>
|
<%@page import="com.nis.util.StringUtils"%>
|
||||||
|
<%@page import="java.util.Properties"%>
|
||||||
|
<%@page import="org.springframework.context.i18n.LocaleContextHolder"%>
|
||||||
|
<%@page import="com.nis.util.Configurations"%>
|
||||||
<%@page contentType="text/html;charset=UTF-8" isErrorPage="true"%>
|
<%@page contentType="text/html;charset=UTF-8" isErrorPage="true"%>
|
||||||
<%@include file="/WEB-INF/include/taglib.jsp"%>
|
<%@include file="/WEB-INF/include/taglib.jsp"%>
|
||||||
<!DOCTYPE html>
|
<!DOCTYPE html>
|
||||||
|
|||||||
@@ -1,15 +1,32 @@
|
|||||||
<%
|
<%
|
||||||
response.setStatus(404);
|
response.setStatus(404);
|
||||||
|
//获取国际化信息
|
||||||
|
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;
|
||||||
|
}
|
||||||
// 如果是异步请求或是手机端,则直接返回信息
|
// 如果是异步请求或是手机端,则直接返回信息
|
||||||
if (Servlets.isAjaxRequest(request)) {
|
if (Servlets.isAjaxRequest(request)) {
|
||||||
out.print("<spring:message code=\"notfound_page\"/>.");
|
out.print(msgProp!=null?msgProp.getProperty("notfound_page"):"Page does not exist");
|
||||||
}
|
}
|
||||||
|
|
||||||
//输出异常信息页面
|
//输出异常信息页面
|
||||||
else {
|
else {
|
||||||
%>
|
%>
|
||||||
<%@page import="com.nis.web.security.Servlets"%>
|
<%@page import="com.nis.web.security.Servlets"%>
|
||||||
|
<%@page import="java.util.Properties"%>
|
||||||
|
<%@page import="org.springframework.context.i18n.LocaleContextHolder"%>
|
||||||
|
<%@page import="com.nis.util.Configurations"%>
|
||||||
<%@page contentType="text/html;charset=UTF-8" isErrorPage="true"%>
|
<%@page contentType="text/html;charset=UTF-8" isErrorPage="true"%>
|
||||||
<%@include file="/WEB-INF/include/taglib.jsp"%>
|
<%@include file="/WEB-INF/include/taglib.jsp"%>
|
||||||
<!DOCTYPE html>
|
<!DOCTYPE html>
|
||||||
|
|||||||
@@ -6,13 +6,27 @@ Throwable ex = Exceptions.getThrowable(request);
|
|||||||
if (ex != null){
|
if (ex != null){
|
||||||
LoggerFactory.getLogger("500.jsp").error(ex.getMessage(), ex);
|
LoggerFactory.getLogger("500.jsp").error(ex.getMessage(), ex);
|
||||||
}
|
}
|
||||||
|
//获取国际化信息
|
||||||
|
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;
|
||||||
|
}
|
||||||
// 编译错误信息
|
// 编译错误信息
|
||||||
StringBuilder sb = new StringBuilder("<spring:message code=\"exception_info\"/>:\n");
|
StringBuilder sb = new StringBuilder(msgProp!=null?msgProp.getProperty("exception_info")+":\n":"Exception Infomation:\n");
|
||||||
if (ex != null) {
|
if (ex != null) {
|
||||||
sb.append(Exceptions.getStackTraceAsString(ex));
|
sb.append(Exceptions.getStackTraceAsString(ex));
|
||||||
} else {
|
} else {
|
||||||
sb.append("<spring:message code=\"unkown_error\"/>.\n\n");
|
sb.append(msgProp!=null?msgProp.getProperty("unkown_error")+":\n\n":"Unkown Error Infomation:\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
// 如果是异步请求或是手机端,则直接返回信息
|
// 如果是异步请求或是手机端,则直接返回信息
|
||||||
@@ -27,6 +41,9 @@ else {
|
|||||||
<%@page import="com.nis.web.security.Servlets"%>
|
<%@page import="com.nis.web.security.Servlets"%>
|
||||||
<%@page import="com.nis.util.Exceptions"%>
|
<%@page import="com.nis.util.Exceptions"%>
|
||||||
<%@page import="com.nis.util.StringUtils"%>
|
<%@page import="com.nis.util.StringUtils"%>
|
||||||
|
<%@page import="java.util.Properties"%>
|
||||||
|
<%@page import="org.springframework.context.i18n.LocaleContextHolder"%>
|
||||||
|
<%@page import="com.nis.util.Configurations"%>
|
||||||
<%@page contentType="text/html;charset=UTF-8" isErrorPage="true"%>
|
<%@page contentType="text/html;charset=UTF-8" isErrorPage="true"%>
|
||||||
<%@include file="/WEB-INF/include/taglib.jsp"%>
|
<%@include file="/WEB-INF/include/taglib.jsp"%>
|
||||||
<!DOCTYPE html>
|
<!DOCTYPE html>
|
||||||
@@ -39,7 +56,7 @@ else {
|
|||||||
<div class="container-fluid">
|
<div class="container-fluid">
|
||||||
<div class="page-header"><h1>500-<spring:message code="system_error"/>.</h1></div>
|
<div class="page-header"><h1>500-<spring:message code="system_error"/>.</h1></div>
|
||||||
<div class="errorMessage">
|
<div class="errorMessage">
|
||||||
<spring:message code="exception_info"/>:<%=ex==null?"<spring:message code=\"unkown_error\"/>.":StringUtils.toHtml(ex.getMessage())%> <br/> <br/>
|
<spring:message code="exception_info"/>:<%=ex==null?(msgProp!=null?msgProp.getProperty("exception_info")+":\n":"Exception Infomation:\n")+"\n":StringUtils.toHtml(ex.getMessage())%> <br/> <br/>
|
||||||
<!-- 请点击“查看详细信息”按钮,将详细错误信息发送给系统管理员,谢谢! -->
|
<!-- 请点击“查看详细信息”按钮,将详细错误信息发送给系统管理员,谢谢! -->
|
||||||
<spring:message code="click_detail"/><br/> <br/>
|
<spring:message code="click_detail"/><br/> <br/>
|
||||||
<a href="javascript:" onclick="history.go(-1);" class="btn"><spring:message code="return_lastpage"/></a>
|
<a href="javascript:" onclick="history.go(-1);" class="btn"><spring:message code="return_lastpage"/></a>
|
||||||
|
|||||||
Reference in New Issue
Block a user