展开全部
public static ModelAndView util(String first,String second,String usertype){
if(!first.equalsIgnoreCase(usertype)
62616964757a686964616fe78988e69d8331333335303534&& !second.equalsIgnoreCase(usertype)){
return new ModelAndView("erros/403","resolveView","/"+first+"Login.html");
}
return null;
}
因为根本不知道你这些代码是否经常使用,如果你就使用了一次,为什么要提取呢?而且如果这些地方都是动态的,有时候可能不提取反而更好,因为可能需要使用反射,我不在你们项目组,所以不知道你们的具体情况,所以无法做更详细的解答public static ModelAndView util(String first,String second,String usertype){
return util(first,second,usertype,"erros/403","resolveView","Login.html");
}
public static ModelAndView util(String first,String second,String usertype,String error,String resolveView,String loginhtml){
if(!first.equalsIgnoreCase(usertype)
&& !second.equalsIgnoreCase(usertype)){
return new ModelAndView(error,resolveView,"/"+first+loginhtml);
}
return null;
}