HttpRequest对象如何存取自定义属性,属性的访问范围是什么?
2条回答 默认 最新
threenewbee 2023-07-06 13:06关注HttpServletRequest request = ...; // 获取HttpServletRequest对象
request.setAttribute("customAttribute", "customValue");
String value = (String) request.getAttribute("customAttribute");
访问范围是单次的请求本回答被题主选为最佳回答 , 对您是否有帮助呢?解决 无用评论 打赏 举报