字符串分割截取实例

proname=/deve/signature?cid= cid&sid=sid
if(StringUtils.isNotBlank(proname)) {
String[] roles = proname.split("[?]")[0].split("/");//【截取0到?中间的即:/deve/signature 再按照/分割成数组【“”,deve,signature】】
    String actionName = roles[roles.length-1];
if("signature".equals(actionName)){
//插入数据库
result = new SimpleJSONResult(false, "初始化身份验证接口失败");
String returnUrl = hosturl +proname;
// 初始化身份验证接口
result = alipayUtils.InitializeCerfity(certName, certNo, returnUrl);
if (result.getSuccess())
result = alipayUtils.getCertifyURL(result.getData().toString());
mv.setViewName("redirect:" + result.getData().toString());
//记录日志
method = proname;
content = "用户开始人脸认证……";
logInfoUtils.insertLog(user, content, method, request);
return mv;
}
}
}
posted @ 2020-05-16 12:03  p_小白  阅读(309)  评论(0编辑  收藏  举报

你再瞅我 还瞅!关注啊