浏览 1339 次
精华帖 (0) :: 良好帖 (0) :: 新手帖 (0) :: 隐藏帖 (0)
|
|
---|---|
作者 | 正文 |
发表时间:2014-05-27
String result="editRulePart"; String role = user.getRole(); if(role.equals("ROLE_UPD_HIGH")) result = "editRule"; if(role.equals("ROLE_UPD_MED")) result = "editRulePart"; return result; 原代码是一个方法。我想添加 根据用户不同转到不同页面。不是登陆就转的那种。 /*** EDIT RULE PAGE ***/ @RequestMapping("/editrule/{ruleId}") public String editRule( ModelMap map, @PathVariable("ruleId") Integer ruleId, @RequestParam(value="action",required=false) String action) { logger.info("edit rule page called (\"/editrule\")"); Rule rule = ruleService.findRuleById(ruleId); if(rule == null) { logger.warn("no found with id = "+ruleId); return "error"; } else { map.addAttribute("action", "updaterule"); List<Enrichment> enrichmentList = enrichmentService.listEnrichment(); map.addAttribute("enrichments", enrichmentList); List<Endpoint> endpointList = endpointService.listEndpoint(); map.addAttribute("endpoints", endpointList); List<Tag> tagList = tagService.listTag(); map.addAttribute("tagList", tagList); RuleFormWrap ruleFormWrap = new RuleFormWrap(); ruleFormWrap.setRule(rule); ruleFormWrap.setAction(action); String filterType; if(rule.getFilter() != null) { filterType = rule.getFilter().getClass().getSimpleName(); ruleFormWrap.getFilters().put(filterType, rule.getFilter()); //for(Filter f : ruleFormWrap.getFilters().values()) f.setId(rule.getFilter().getId()); } else { filterType = "none"; } ruleFormWrap.setSelectedFilter(filterType); map.addAttribute("ruleFormWrap", ruleFormWrap); String result="editRulePart"; String role = user.getRole(); if(role.equals("ROLE_UPD_HIGH")) result = "editRule"; if(role.equals("ROLE_UPD_MED")) result = "editRulePart"; return result; } } 声明:ITeye文章版权属于作者,受法律保护。没有作者书面许可不得转载。
推荐链接
|
|
返回顶楼 | |