Struts 기반 포틀릿을 다른 포틀릿을 사용했을 때의 견해를 기억할 수 있습니까?

StackOverflow https://stackoverflow.com/questions/1205926

문제

Struts Portlet Bridge를 사용하여 상당히 기본적인 포틀릿을 작성하여 Liferay에 배포했습니다. 포틀릿 내 탐색은 괜찮은 것처럼 보이지만 포털의 다른 포틀릿에서 링크를 클릭 할 때마다 포틀릿이 내 포틀릿의보기 조치 설정으로 되돌아갑니다. 기존 상태를 다시 렌더링하는 대신 XML. 내가 뭘 잘못하고 있죠?

나의 portlet.xml 이다:

<?xml version="1.0"?>

<portlet-app xmlns="http://java.sun.com/xml/ns/portlet/portlet-app_2_0.xsd" version="2.0"
             xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
             xsi:schemaLocation="http://java.sun.com/xml/ns/portlet/portlet-app_2_0.xsd">
  <portlet>
    <portlet-name>test</portlet-name>
    <display-name>Test</display-name>
    <portlet-class>com.perceptive.ctms.test.portlet.TestPortlet</portlet-class>

    <init-param>
      <name>ServletContextProvider</name>
      <value>com.liferay.util.bridges.struts.LiferayServletContextProviderWrapper</value>
    </init-param>
    <init-param>
      <name>StrutsPortletConfigLocation</name>
      <value>/WEB-INF/struts-portlet-config.xml</value>
    </init-param>
    <init-param>
      <name>HelpPage</name>
      <value>/portlet_action/test/help</value>
    </init-param>
    <init-param>
      <name>ViewPage</name>
      <value>/portlet_action/test/start</value>
    </init-param>
    <init-param>
      <name>EditPage</name>
      <value>/portlet_action/test/preferences</value>
    </init-param>

    <expiration-cache>0</expiration-cache>
    <supports>
      <mime-type>text/html</mime-type>
      <portlet-mode>view</portlet-mode>
      <portlet-mode>edit</portlet-mode>
      <portlet-mode>help</portlet-mode>
    </supports>
    <portlet-info>
      <title>Test</title>
      <short-title>Test</short-title>
      <keywords>Test</keywords>
    </portlet-info>
  </portlet>

  <filter>
    <filter-name>AuthenticationFilter</filter-name>
    <filter-class>com.perceptive.ctms.framework.portlet.filter.AuthenticationFilter</filter-class>
    <lifecycle>RENDER_PHASE</lifecycle>
    <lifecycle>ACTION_PHASE</lifecycle>
  </filter>

  <filter-mapping>
    <filter-name>AuthenticationFilter</filter-name>
    <portlet-name>test</portlet-name>
  </filter-mapping>
</portlet-app>

그리고 struts-portlet-config.xml 이다:

<?xml version="1.0" encoding="UTF-8"?>

<config>
  <render-context>
    <attribute name="errors"/>
    <attribute name="message" keep="true"/>
    <attribute prefix="com.perceptive" keep="true"/>
  </render-context>
  <portlet-url-type default="render">
    <render path="/test/help.do"/>
    <render path="/test/start.do"/>
    <render path="/test/preferences.do"/>
    <render path="/test/tableTest.do"/>
    <render path="/test/displayTagTest.do"/>
    <render path="/test/lookupTest.do"/>
    <render path="/test/lookupTestSave.do"/>
  </portlet-url-type>
</config>

추신 : 나는 이미 Liferay 포럼에서 이것을 물었지만 빠른 답변을 희망하여 여기에서 묻고 있습니다.

도움이 되었습니까?

해결책

에서 portlet.xml 선을 변경해보십시오.

<expiration-cache>0</expiration-cache>

이는 포틀릿의 캐시 버전이 즉시 만료된다는 것을 의미합니다.

<expiration-cache>-1</expiration-cache>

그것은 결코 만료되지 않는다는 것을 의미합니다. 로부터 portlet-app_2_0.xsd:

<annotation>
    <documentation>
        Expiration-time defines the time in seconds after which the portlet output expires. 
        -1 indicates that the output never expires.
        Used in: portlet
    </documentation>
</annotation>
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top