且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

如何从servlet调用通用Portlet方法?

更新时间:2023-12-04 14:28:26

您不能,我的答案与我对您的

You can't, and my answer is very similar to my answer to your very similar question.

调用portlet的生命周期方法是框架的(门户的)业务. 不是您的.

It's the framework's (portal's) business to call the lifecycle methods of a portlet. Not yours.

您需要重新考虑问题并提出不同的体系结构.或者给我们您的问题,以提出与您目前正在寻求的解决方案不同的解决方案.

You need to rethink your problem and come up with a different architecture. Or give us your problem to suggest a different solution than the one that you're currently pursuing.

与该答案不同,我假设在这种情况下,您位于同一个Web应用程序中(Portlet和Servlet部署在同一个Webapp中).但是,就像在其他问题一样,Portlet的请求将通过门户进行路由,而Servlet的请求则不会.您将没有可用的数据.

Differing from that answer, I'm assuming that in this case you're within the very same same web application (portlet and servlet are deployed in the same webapp). However, just like in that other question, a portlet's request is routed through the portal while the servlet's request is not. You'll not have the data available.