0 Replies Latest reply on May 29, 2007 5:24 AM by Sonal K.

    help: same class file for 2 portlets

    Sonal K. Newbie

      Hello everyone,
      I am developing a JSF portlet application. In that in portlet.xml file, I m same portlet-class for both the portlets.

      Portlet.xml-->

      <?xml version="1.0" encoding="UTF-8"?>
      <portlet-app xmlns="http://java.sun.com/xml/ns/portlet/portlet-app_1_0.xsd"
      xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
      xsi:schemaLocation="http://java.sun.com/xml/ns/portlet/portlet-app_1_0.xsd http://java.sun.com/xml/ns/portlet/portlet-app_1_0.xsd"
      version="1.0">

      <portlet-name>HelloWorldJSFPortlet</portlet-name>
      <portlet-class>org.apache.myfaces.portlet.MyFacesGenericPortlet</portlet-class>
      <init-param>
      default-view
      /WEB-INF/jsp/image_dd2.jsp
      </init-param>

      <mime-type>text/html</mime-type>
      <portlet-mode>VIEW</portlet-mode>

      <portlet-info>
      HelloWorld JSF Portlet
      </portlet-info>


      <portlet-name>ImagePortlet</portlet-name>
      <portlet-class>org.apache.myfaces.portlet.MyFacesGenericPortlet</portlet-class>
      <init-param>
      default-view
      /WEB-INF/jsp/image_dd.jsp
      </init-param>

      <mime-type>text/html</mime-type>
      <portlet-mode>VIEW</portlet-mode>

      <portlet-info>
      Image Portlet
      </portlet-info>

      </portlet-app>

      This is how my portlet.xml is. Here 2 instances are getting created, but both the portlet windows are referring to same jsp file and the window names are also same. Why is this happening? Is it bcoz I m giving same class file for both the JSP's??
      Thanks in advance.