WebService中获取request对象一例

@WebService
@Service
public class WeiXinWebServiceImpl implements IWeiXinWebService {

    @Resource 
    private WebServiceContext webServiceContext; 

    public String getLoginUser() {
        HttpServletRequest request = (HttpServletRequest) webServiceContext.getMessageContext().get(MessageContext.SERVLET_REQUEST);
        HttpSession session = request.getSession();
        return session.getAttribute("loginUser").toString();
    }
}

 

posted @ 2015-10-27 09:50  剑握在手  阅读(1555)  评论(0编辑  收藏  举报
返回顶部↑