7 Replies Latest reply on Sep 3, 2007 2:14 AM by habicht hawk

    preferences in portlet-instances.xml

    habicht hawk Newbie

      hi! i'm trying to read preferences out of the portlet-instances.xml but it doesn't work. i've read other posts concerning the same topic but i couldn't find a solution. the only thing that works is getting the value from the portlet.xml file.

      public class PortletA extends GenericPortlet
      {
      protected void doView(RenderRequest request, RenderResponse response)
      throws PortletException, PortletSecurityException, IOException
      {
      System.out.println(request.getPreferences().getValue
      }

      }


      <?xml version="1.0" encoding="UTF-8"?>
      <portlet-app id="PortletA" version="1.0">
      <portlet id="PortletA">
      <portlet-name>portleta</portlet-name>
      <display-name>portleta</display-name>
      <portlet-class>test.PortletA</portlet-class>
      <expiration-cache>0</expiration-cache>
      <supports>
      <mime-type>text/html</mime-type>
      <portlet-mode>VIEW</portlet-mode>
      </supports>
      <portlet-info>
      <short-title>Portlet A</short-title>
      <keywords>Portlet</keywords>
      </portlet-info>
      <portlet-preferences>
      <preference>
      <name>test</name>
      <value>portlet.xml</value>
      </preference>
      </portlet-preferences>
      </portlet>
      </portlet-app>


      <deployments>
      <deployment>
      <instance>
      <instance-id>PortletAInstance</instance-id>
      <portlet-ref>portleta</portlet-ref>
      <preferences>
      <preference>
      <name>test</name>
      <value>portlet-instances.xml</value>
      </preference>
      </preferences>
      </instance>
      </deployment>
      </deployments>


      so looking at my files this means that i receive portlet.xml inestad of portlet-instances.xml

      Windows XP Pro SP2
      jdk 1.5.0_09
      JBoss Portal 2.6 Bundle (binary)
      Postgres 8.3
      Hibernate 3

      thanks in advance
      habicht