2 Replies Latest reply on Apr 1, 2008 2:09 PM by Pete Muir

    RequestParameter is null inside Factory method

    Gavin Ellis Newbie

      I'm setting a variable with the @RequestParameter annotation and then wanting to use this in a method annotated with @Factory, but finding the variable is null at this point. When the event handling method is invoked it is then populated as expected. Is this a bug? I have seen guides which claim that the request parameter values should be populated and available inside @Factory annotated methods. Here is the abridged code:


      @Stateful
      @Name("appController")
      @Scope(ScopeType.SESSION)
      public class ControllerImpl implements Controller {
              
              @RequestParameter("applicationCode")
              String applicationCode;
      
              @In(required = true)
              Application application;
      
              @Override
              @Remove
              public void destroy() {
              }
      
              @Override
              public void processRequest() {
                 // applicationCode is not null in here
              }
      
              @Factory(value = "application")
              public void initApplication() {
                 // applicationCode is null in here
              }
      
      }