0

在为我的站点配置管理页面时,我正在关注LightAdmin站点。有以下代码:

<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>

我真的不知道“带有管理配置的软件包”是什么,也不知道它应该在哪里。我在哪里可以找到它?

4

1 回答 1

1

这是您在定义管理配置时选择的包名称。从Light Admin 页面上的示例:

在下面的类的顶部,您将拥有类似的内容:

包 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>
于 2015-10-13T15:07:34.123 回答