0 Replies Latest reply on Sep 27, 2006 10:58 PM by wang wei

    Problems about Injecting Services in the portlet context

    wang wei Newbie

      Hi all,

      I read the Jportal 2.4.0 refereence guide and know in the jboss-portlet.xml ,we can Inject Services in the portlet context. so I do the same thing like the reference .But I do it in Portal 2.2.0, I don't think there is any diference.

      <portlet-app>

      <service-name>UserModule</service-name>
      <service-class>org.jboss.portal.identity.UserModule</service-class>
      <service-ref>:service=Module,type=User</service-ref>

      </portlet-app>


      then in my portlet i Write:

      UserModule userModule = (UserModule) getPortletContext().getAttribute("UserModule");
      String userId = request.getParameters().getParameter("userid");
      User user = userModule.findUserById(userId);

      but when I test, firstly, I login then I found userModule is null , and also user is null. so anyone can help me solve this problem? I want get the user object in the context. Thanks. !