URL url;
try {
url = new URL(refer);
String host = url.getHost();
if(!StringUtils.equals(req.getServerName(),host)){
ExternalReferBean rbean = new ExternalReferBean();
rbean.setUrl(refer);
rbean.setClientAddr(req.getRemoteAddr());
rbean.setReferTime(new Date());
rbean.setRefId(ref_id);
rbean.setRefType(ref_type);
rbean.setSite(site);
rbean.setHost(host);
ExternalReferDAO.save(rbean);
}
} catch (Exception e) {
log.error("Save refer failed, ip="+req.getRemoteAddr()+",refer="+refer, e);
} finally {