常用的代码片段

1、对象属性值copy

import org.springframework.beans.BeanUtils;
BeanUtils.copyProperties(oldObj, newObj);

2、获取request的请求信息

HttpServletRequest request = HttpContextUtils.getHttpServletRequest();
String serviceInfo = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort()+"/"+request.getContextPath();

你可能感兴趣的:(java,前端,服务器)