1

環境:

ワイルドフライ 9.0.1

JSF: jsf-impl-2.2.11-jbossorg-1

溶接: wildfly-weld-9.0.1

私はこのシナリオを持っています:

CustomerController.java

public abstract class CustomerController {

   public String registerCustomer(){
      //Do something and return success page
      return SUCCESS_PAGE;
   }
}

Type1CustomerController.java

@Named
@ViewScoped
public class Type1CustomerController extends CustomerController{

     public String registerCustomer(){
       super.registerCustomer();

      //Special case, just go back to login and allow login
      return SUCCESS_LOGIN_PAGE;
   }
}

Type2CustomerController.java

@Named
@ViewScoped
public class Type2CustomerController extends CustomerController {

   //Does not override the registerCustomer method, but adds some functionlities based on some abstract definitions on the superclass and simply shows success_page
}

CustomerSelectionController.java

@ApplicationScoped
public class CustomerSelectionController {

   @Inject
   private Instance<Type2CustomerController> type2CustomerController;


   @Inject
   private Instance<Type1CustomerController> type1CustomerController;

   @Produces
   @ViewScoped
   @Named("customerController")
   public CustomerController customerController() {
      if(someConditionsAreMet())
         return type1CustomerController.get();

       //Otherwise return type2 customer controller
      return type2CustomerController.get();
   }
}

Type2CustomerControllerが選択されると、すべて正常に動作します。Type1CustomerController災害が発生した場合:

Method not found: class com.mycompany.view.internal.controller.customer.Type1CustomerController$Proxy$_$$_WeldClientProxy.registerCustomer()
    at com.sun.faces.facelets.el.TagMethodExpression.invoke(TagMethodExpression.java:109)
    at javax.faces.component.MethodBindingMethodExpressionAdapter.invoke(MethodBindingMethodExpressionAdapter.java:87)
    at com.sun.faces.application.ActionListenerImpl.processAction(ActionListenerImpl.java:102)

Type1Controller でオーバーライドされたスーパークラス メソッドが EL で見つからないという問題は何ですか?

4

0 に答える 0