Usage of PortalDelegateServlet in Liferay

这一生的挚爱 提交于 2019-12-02 08:17:47

问题


I'm trying to create a servlet which shares liferay session contents with my application.So I need to use PortalDelegateServlet.But I can not find in how to import this library to my project.I can not find any .jar files or something.

How can I import liferay java library to my project?


回答1:


PortalDelegateServlet is in portal-service.jar which is a required part of the Liferay container. If you grabbed a bundle (which in comment you mention the Tomcat bundle), then it is provided for you. All you should need to do is configure your web.xml:

  <servlet>
    <!-- http://issues.liferay.com/browse/LEP-2297 -->
    <servlet-name>service</servlet-name>
    <servlet-class>com.liferay.portal.kernel.servlet.PortalDelegateServlet</servlet-class>
    <init-param>
      <param-name>servlet-class</param-name>
      <param-value>com.example.MyServlet</param-value>
    </init-param>
    <load-on-startup>1</load-on-startup>
  </servlet>

  <servlet-mapping>
    <servlet-name>service</servlet-name>
    <url-pattern>/*</url-pattern>
  </servlet-mapping>

This Liferay issue (which is linked to in the source for PortalDelegateServlet) makes it sound as if this has been available since version 4.3.0



来源:https://stackoverflow.com/questions/26753468/usage-of-portaldelegateservlet-in-liferay

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!