修正配置controller的消息重定向后无法传至前台的问题,使用model的模式改为redirectAttributes模式
This commit is contained in:
@@ -46,7 +46,7 @@ public class IpMultiplexPoolCfgController extends BaseController {
|
||||
initFormCondition(model, cfg);
|
||||
}
|
||||
|
||||
//查询policyGroup列表,供响应策略选择
|
||||
//查询ip复用地址池配置的policyGroup列表
|
||||
List<PolicyGroupInfo> policyGroups=policyGroupInfoService.findPolicyGroupInfosByType(2);
|
||||
model.addAttribute("policyGroups", policyGroups);
|
||||
|
||||
@@ -56,16 +56,16 @@ public class IpMultiplexPoolCfgController extends BaseController {
|
||||
|
||||
@RequestMapping(value = {"/saveOrUpdate"})
|
||||
@RequiresPermissions(value={"ip:mulitiplex:pool:config"})
|
||||
public String saveOrUpdate(Model model,HttpServletRequest request,HttpServletResponse response,
|
||||
public String saveOrUpdate(Model model,HttpServletRequest request,HttpServletResponse response,RedirectAttributes redirectAttributes,
|
||||
@ModelAttribute("cfg")IpMultiplexPoolCfg cfg){
|
||||
try{
|
||||
|
||||
ipMultiplexPoolCfgService.saveOrUpdate(cfg);
|
||||
|
||||
addMessage(model,"save_success");
|
||||
addMessage(redirectAttributes,"save_success");
|
||||
}catch(Exception e){
|
||||
e.printStackTrace();
|
||||
addMessage(model,"save_failed");
|
||||
addMessage(redirectAttributes,"save_failed");
|
||||
}
|
||||
|
||||
return "redirect:" + adminPath +"/maintenance/ipMultiplexPoolCfg/list?functionId="+cfg.getFunctionId();
|
||||
@@ -82,14 +82,15 @@ public class IpMultiplexPoolCfgController extends BaseController {
|
||||
|
||||
@RequestMapping(value = {"/delete"})
|
||||
@RequiresPermissions(value={"ip:mulitiplex:pool:config"})
|
||||
public String delete(Integer isAudit,Integer isValid,String ids,Integer functionId,Model model,HttpServletRequest request,HttpServletResponse response){
|
||||
public String delete(Integer isAudit,Integer isValid,String ids,Integer functionId,Model model,RedirectAttributes redirectAttributes
|
||||
,HttpServletRequest request,HttpServletResponse response){
|
||||
try{
|
||||
if(!StringUtil.isEmpty(ids)){
|
||||
ipMultiplexPoolCfgService.delete(isAudit,isValid,ids,functionId);
|
||||
}
|
||||
addMessage(model,"delete_success");
|
||||
addMessage(redirectAttributes,"delete_success");
|
||||
}catch(Exception e){
|
||||
addMessage(model,"delete_failed");
|
||||
addMessage(redirectAttributes,"delete_failed");
|
||||
}
|
||||
|
||||
return "redirect:" + adminPath +"/maintenance/ipMultiplexPoolCfg/list?functionId="+functionId;
|
||||
@@ -106,7 +107,7 @@ public class IpMultiplexPoolCfgController extends BaseController {
|
||||
ipMultiplexPoolCfgService.audit(isAudit,isValid,functionId,id,auditTime);
|
||||
} catch (MaatConvertException e) {
|
||||
e.printStackTrace();
|
||||
logger.info("VOIP配置下发失败:"+e.getMessage());
|
||||
logger.info("IP复用地址池配置下发失败:"+e.getMessage());
|
||||
addMessage(redirectAttributes, e.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -53,14 +53,14 @@ public class DdosCfgController extends BaseController {
|
||||
@RequestMapping(value = {"/saveOrUpdate"})
|
||||
@RequiresPermissions(value={"ddos:ip:config"})
|
||||
public String saveOrUpdate(Model model,HttpServletRequest request,HttpServletResponse response,
|
||||
@ModelAttribute("cfg")DdosIpCfg cfg){
|
||||
@ModelAttribute("cfg")DdosIpCfg cfg, RedirectAttributes redirectAttributes){
|
||||
try{
|
||||
ddosCfgService.saveOrUpdate(cfg);
|
||||
addMessage(model,"save_success");
|
||||
addMessage(redirectAttributes,"save_success");
|
||||
}catch(Exception e){
|
||||
logger.error("信息保存失败",e);
|
||||
e.printStackTrace();
|
||||
addMessage(model,"save_failed");
|
||||
addMessage(redirectAttributes,"save_failed");
|
||||
}
|
||||
|
||||
return "redirect:" + adminPath +"/manipulation/ddos/list?functionId="+cfg.getFunctionId();
|
||||
|
||||
@@ -92,7 +92,7 @@ public class AvController extends BaseController {
|
||||
}
|
||||
//保存文件样例配置
|
||||
@RequestMapping(value = {"/sample/saveFileSample"})
|
||||
public String saveFileSample(Model model,HttpServletRequest request,HttpServletResponse response,
|
||||
public String saveFileSample(Model model,HttpServletRequest request,HttpServletResponse response, RedirectAttributes redirectAttributes,
|
||||
String ids,AvFileSampleCfg entity,MultipartFile srcFile,MultipartFile sampleFile){
|
||||
try{
|
||||
if(srcFile!=null && sampleFile!=null &&
|
||||
@@ -129,14 +129,14 @@ public class AvController extends BaseController {
|
||||
}catch(Exception e){
|
||||
logger.error("文件上传失败",e);
|
||||
e.printStackTrace();
|
||||
addMessage(model,"file_upload_failed");
|
||||
addMessage(redirectAttributes,e.getMessage());
|
||||
}
|
||||
|
||||
return "redirect:" + adminPath +"/ntc/av/sample/fileSampleList?functionId="+entity.getFunctionId();
|
||||
}
|
||||
//保存标志样例配置
|
||||
@RequestMapping(value = {"/sample/saveSignSample"})
|
||||
public String saveSignSample(Model model,HttpServletRequest request,HttpServletResponse response,String ids,AvSignSampleCfg entity){
|
||||
public String saveSignSample(Model model,HttpServletRequest request,HttpServletResponse response, RedirectAttributes redirectAttributes,String ids,AvSignSampleCfg entity){
|
||||
avCfgService.saveOrUpdateAvSignSample(entity);
|
||||
return "redirect:" + adminPath +"/ntc/av/sample/signSampleList?functionId="+entity.getFunctionId();
|
||||
}
|
||||
|
||||
@@ -137,14 +137,14 @@ public class HttpRedirectPolicyController extends BaseController{
|
||||
@RequestMapping(value = {"saveOrUpdate"})
|
||||
@RequiresPermissions(value={"control:httpRedirect:config"})
|
||||
public String saveOrUpdate(Model model,HttpServletRequest request,HttpServletResponse response,
|
||||
@ModelAttribute("cfg")CfgIndexInfo cfg){
|
||||
@ModelAttribute("cfg")CfgIndexInfo cfg,RedirectAttributes redirectAttributes){
|
||||
try{
|
||||
httpRedirectCfgService.saveHttpCfg(cfg);
|
||||
addMessage(model,"save_success");
|
||||
addMessage(redirectAttributes,"save_success");
|
||||
}catch(Exception e){
|
||||
logger.error("信息保存失败",e);
|
||||
e.printStackTrace();
|
||||
addMessage(model,"save_failed");
|
||||
addMessage(redirectAttributes,"save_failed");
|
||||
}
|
||||
|
||||
return "redirect:" + adminPath +"/proxy/control/httpRedirect/list?functionId="+cfg.getFunctionId();
|
||||
|
||||
Reference in New Issue
Block a user