Stop exception from being thrown for non-existent controller

前端 未结 4 1465
攒了一身酷
攒了一身酷 2021-02-15 09:50

Ok, so I am stumped on this issue. I have seen a lot of things that are supposed to resolve this issue, but I am not getting a resolution that can fulfill my requirements.

4条回答
  •  走了就别回头了
    2021-02-15 10:37

    Wire up a custom controller factory that can execute your desired features when it fails to locate the requested controller. It's just a few lines of code, nothing too painful.

    You can roll your own controller factory, or use one of the many libraries as a starting point. You'll have a class that implements IControllerFactory and inside the CreateController() function will be your custom logic.

提交回复
热议问题