Spring webflow 中的 HttpServletRequest 对象?
如何在FlowController
中获取HttpServletRequest
对象?
我试图从 getNativeRequest() 方法检索请求对象,但它没有给出 HttpServletRequest 对象。
(HttpServletRequest)RequestContextHolder.getRequestContext().getExternalContext().getNativeRequest()
我遵循上述方法,它返回 SRTServletRequest
对象。
How to get HttpServletRequest
object in FlowController
?
I am trying to retrieve request object from getNativeRequest()
method,But it is not giving HttpServletRequest object.
(HttpServletRequest)RequestContextHolder.getRequestContext().getExternalContext().getNativeRequest()
I followed above approach, It's returning SRTServletRequest
object.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
如果我错了,请纠正我,但是
SRTServletRequest
实现了HttpServletRequest
,所以您应该能够投射它。Correct me if I'm wrong, but
SRTServletRequest
implementsHttpServletRequest
, so you should just be able to cast it.