代码之家  ›  专栏  ›  技术社区  ›  S.P. ROOPESH

如何为内部类加载资源包?使用wicket 6.6

  •  0
  • S.P. ROOPESH  · 技术社区  · 7 年前
    Unable to find property: 'registerform.agencyName.Required' for component:  [class=com.brazil.clasadm.application.AppnRegister$AppnRegisterForm].
    

    我的场景如下:

    public class AppnRegister extends someotherClass {
    
            public AppnRegister() {
                add(new AppnRegisterForm("registerform"));
            }
            class AppnRegisterForm extends Form {
            TextField agencyName= null;
            agencyName = new TextField("agencyName", new PropertyModel(cac, "agencyName"));
        agencyName .getLocalizer().getString("registerform.agencyName.Required", this);
            }
            }
    

    1 回复  |  直到 7 年前
        1
  •  1
  •   martin-g    7 年前

    是什么 AppnRegister extends ... 在你的代码中!

    内部类应该是 static AppnRegister$AppnRegisterForm .

    解决:

    • 使用 AppnRegister.properties
    • wicket-package.properties

    两者都应该在旁边 AppnRegister.class 在类路径中。

    推荐文章