request的使用

一个URL请求:
http://localhost:9080/Navigation/gotoThinkPosition.do?methodName=gotoThinkPosition
System.out.println("request url: "+request.getRequestURL());
//打印结果如下:request url: http://localhost:9080/Navigation/gotoThinkPosition.do
System.out.println("request query String: "+request.getQueryString());
//打印结果如下:request query String: methodName=gotoThinkPosition
public UserInfoBean getUserInfo(HttpServletRequest request) {
HttpSession session = request.getSession(false);
UserInfoBean user = null;
if (session.getAttribute(SupportConstants.USERINFO) == null) {
user = new UserInfoBean("");
user.setUid(com.huawei.it.support.privilege.Constants.ANONYMOUS);
} else {
user = (UserInfoBean) session.getAttribute(SupportConstants.USERINFO);
}
return user;
}

你可能感兴趣的:(request的使用)