2 Replies Latest reply on Apr 25, 2010 1:03 AM by Lucas Paes

    RequestParameter is null in Stateful SB

    alain hsiung Newbie

      The RequestParameter in my EntityHome (WebServiceHome) is working correctly.

      But when I transform this EntityHome in a Stateful SessionBean (adding @Stateful an implements the @Local interface)
      the same RequestParameter is always null!

      What am I doing wrong?

      The WebServiceHome Stateful SB:

      package com.csg.cs.wsrepository.session;
      import javax.ejb.Remove;
      import javax.ejb.Stateful;
      import com.csg.cs.wsrepository.entity.WebService;
      import org.jboss.seam.ScopeType;
      import org.jboss.seam.annotations.Name;
      import org.jboss.seam.annotations.Begin;
      import org.jboss.seam.annotations.Scope;
      import org.jboss.seam.annotations.web.RequestParameter;
      import org.jboss.seam.faces.Redirect;
      import org.jboss.seam.framework.EntityHome;
      public class WebServiceHome extends EntityHome<WebService> implements WebServiceInterface
         @RequestParameter String webServiceId;
          public Object getId() {
               System.out.println("@RequestParameter webServiceId " + webServiceId);
               String webServiceId = (String) Redirect.instance().getParameters().get("webServiceId");
               System.out.println("@RequestParameter webServiceId " + webServiceId);
               if (webServiceId == null) {
                     return super.getId();
                } else {
                     return webServiceId;
          public Class<WebService> getEntityClass() {
               return WebService.class;
          @Override @Begin
          public void create() {
               System.out.println("create webServiceId " + webServiceId);
               System.out.println("create webServiceId " + webServiceId);
          public String persist()
               String result = super.persist();
               System.out.println("**************** persist WebService");
               return result;
          public String update()
               String result = super.update();
               System.out.println("**************** update WebService");
               return result;
          public String remove() {
               return "removed";