2015-10-13 68 views
0

我正在關注LightAdmin網站,同時爲我的網站配置管理頁面。有下面的代碼:LightAdmin Spring配置

<context-param> 
<param-name>light:administration:base-package</param-name> 
    <param-value>[package with Administration Configurations, ex.: org.lightadmin.demo.config]</param-value> 
</context-param> 

我真的不知道「管理配置包」是什麼或它應該是什麼地方。我在哪裏可以找到它?

回答

1

這是您在定義Adminstration配置時選擇的軟件包名稱。從上Light Admin page的例子:

在類的頂部下面你會碰到這樣的:

包com.YOUR_APPLICATION.config;

public class UserAdministration extends AdministrationConfiguration<User> { 

public EntityMetadataConfigurationUnit configuration(EntityMetadataConfigurationUnitBuilder configurationBuilder) { 
return configurationBuilder.nameField("firstname").build(); 
} 

public ScreenContextConfigurationUnit screenContext(ScreenContextConfigurationUnitBuilder screenContextBuilder) { 
return screenContextBuilder 
.screenName("Users Administration").build(); 
} 

public static FieldSetConfigurationUnit listView(final FieldSetConfigurationUnitBuilder fragmentBuilder) { 
return fragmentBuilder 
.field("firstname").caption("First Name") 
.field("lastname").caption("Last Name") 
.build(); 
} 

然後你的配置是這樣的:

<context-param> 
<param-name>light:administration:base-package</param-name> 
    <param-value>com.YOUR_APPLICATION.config</param-value> 
</context-param>