是否有一种方法,仅使用标准 oracle JSR-286 类来获取 portlet 请求后面的 HttpServletRequest?这里是liferay特有的方法
HttpServletRequest httpRequest =
PortalUtil.getOriginalServletRequest(
PortalUtil.getHttpServletRequest(portletRenderRequest));
提前非常感谢
最佳答案
为了直接回答您的问题,我会尝试使用 Vamshi 提供的解决方案 here 。我认为该解决方案仍然可能是特定于 portlet 容器的,因为我在 JSR-286 规范中没有看到任何提及这一点。我自己只使用了容器特定的解决方案。
在更一般的讨论中,我将引导您访问 Why is the servlet request not available in the portlet API Portlet 不是 servlet,因此请确保您没有尝试以这种方式使用它们。
关于java - Portal-container中立的方法从portlet请求中获取httpservletrequest,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/17831338/