1 Reply Latest reply on Apr 29, 2009 4:51 AM by je.a.le

    Portlet, Servlets, cross context

      Hi all,

      just facing a problem to access a jsp from an external servlet but in fact of security reasons I need some sort of validation or something. I was thinking to share the session objects between some of my portlets and my servlet.

      Is there any possibility to configure a cross-context for the portal aka jBoss AS which runs under the hood?

      Any advice would be appreciated

      Regards

      thinwath

        • 1. Re: Portlet, Servlets, cross context
          je.a.le

          you can't share session (data) between application. Since you using servlet, you can't use portalsession neither.

          If i understood, you're using jbossportal as container ( and logging solution) and an external application - on the same server - must get identification before processing.

          You should look at PortalEventListener ; there's an example on the official doc ( and i posted some sample code in a topic over there).

          In a similar problem I went with PortalEventListener and a ejb (an jboss jmx actually), Session id come from the client, so it is indeed the same across application. the listener take care of login/logout authentication (providing id of user) and session cleanup too. it then calls my jmx providing user id and session id. My servlet (dwr) gets information about the current user with its session id.

          It's not the more secure solution but suitable for most of web application.

          My ejb/jmx needs those jmx :
          portal:service=Module,type=User
          portal:service=Module,type=Membership
          portal:service=Module,type=IdentityServiceController

          and register the listener at runtime with :
          portal:service=ListenerRegistry

          Hope it helped