从 HttpServletRequest 创建 pageContext
我知道这可能听起来很疯狂...但我正在与一些第三方 api 集成,不幸的是他们有一个只需要 pageContext 对象的实用程序类..我四处看了看,发现他们正在使用 pageContext 做很多事情...有没有办法从 HttpServeletRequest 获取或创建 pageContext。
I know this might sound crazy...but i am integrating with some third party api's and unfortunately they have a utility class which only takes a pageContext object..I did some peeking around and found that they are doing a lot of stuff with pageContext... Is there a way to get to or create a pageContext from HttpServeletRequest.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您可以使用 MockPageContext 来自 Spring API。 它是为测试而设计的,但它可以很好地欺骗应用程序,让其认为它是真实的。
You could use MockPageContext from the Spring API. It's designed for testing, but it would do a fine job of fooling the app into thinking it was the real thing.