我是靠谱客的博主 包容钻石,这篇文章主要介绍service中获取request、session、ServletContext,现在分享给大家,希望可以做个参考。

public String getLoginPersonDeptId() throws Exception {
		ServletRequestAttributes attribute = (ServletRequestAttributes) RequestContextHolder.currentRequestAttributes();
		return attribute.getRequest().getSession().getAttribute("#_branchId").toString();
	}


String dstPath =  ContextLoader.getCurrentWebApplicationContext().getServletContext().getRealPath("\tmp");

 

 

最后

以上就是包容钻石最近收集整理的关于service中获取request、session、ServletContext的全部内容,更多相关service中获取request、session、ServletContext内容请搜索靠谱客的其他文章。

本图文内容来源于网友提供,作为学习参考使用,或来自网络收集整理,版权属于原作者所有。
点赞(125)

评论列表共有 0 条评论

立即
投稿
返回
顶部