Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
Grails请求对象是HttpServletRequest的一个实例。有什么方法可以从请求对象中获取唯一的 id?我的最终目标是存储特定于请求的会话数据,因此我需要一个String可以用作唯一标识符的或数字。
String
也许添加一个唯一的 id 作为请求属性?
request.setAttribute('UID', Math.random())
为什么不在过滤器中使用静态 ThreadLocal?