[jboss-user] [JBoss Seam] - Using Seam for porlet communication

jarkko@jab.fi do-not-reply at jboss.com
Wed Sep 20 18:46:01 EDT 2006


Hello,
 I'd like to use Seam to help JSR-168 portlets to  communicate between each others (e.g. portlet1.jsp, portlet2.jsp). My first very naive approach (using Statefull Session Beans) didn't seem to work. Maybe it didn't work because somebody (JSF,Seam?) sees the two portlets as two different "clients", so different SFSBs are created for two different portlets.

Portlet1.jsp uses action1 (SFSB) to get a list of organizations, action2 is different SFSB.

action1.java

  | @DataModel
  | List organizations;
  | 

portlet1.jsp

  | <h:dataTable value="#{organizations}"  var="org">
  |     <h:commandLink value="#{org.name}" action="#{action2.getEventsForOrg}">
  | 	    	<f:param name="organizationId" value="#{org.organizationId}" />
  | 	    </h:commandLink>


action2.java

  | @RequestParameter("organizationId")
  | private String organizationId;
  | 
  | @DataModel(value = "orgEvents")
  | List orgEvents;
  | 

portlet2.jsp

  | <h:dataTable value="#{orgEvents}"  var="event">
  |   <h:column>
  | 	    <f:facet name="header">
  | 	      <h:outputText value="Type" />
  | 	    </f:facet>
  |   	<h:outputText value="#{event.type}" />
  |   </h:column>                        
  | </h:dataTable>
  | 


pages.xml

  | <pages>
  | 	 <page view-id="/portlet2.jsp" action="#{action2.getEventsForOrg}" /> 
  | </pages>
  | 


However, it seems that two different instances of action2 are created, one for the portlet1.jsp (action="#{action2.getEventsForOrg}" and other one for portlet2.jsp accesses. It doesn't matter if i use the pages.xml above or call action2 inside the portlet2.jsp. 

Is this Seam abuse ;) or misconfiguration? 





View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3973105#3973105

Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3973105



More information about the jboss-user mailing list