java服务端返回关闭当前支付宝/微信h5窗口

String userAgent = request.getHeader("user-agent").toLowerCase();
PrintWriter writer = response.getWriter();
StringBuilder sb = new StringBuilder();

//微信客户端
if(userAgent.indexOf("micromessenger") != -1){
    sb.append("");
    sb.append("");
    sb.append("");
    sb.append("");
    sb.append("");
}
//支付宝
else if(userAgent.indexOf("alipay") != -1){
    sb.append("");
    sb.append("");
    sb.append("");
    sb.append("");
    sb.append("");
}
writer.write(sb.toString());

 

你可能感兴趣的:(java服务端返回关闭当前支付宝/微信h5窗口)