定義系統公用變量方法

in AppModule.java

public static void contributeApplicationDefaults(
           MappedConfiguration<String, String> configuration)
   {
       configuration.add("tutor.file-system-root", "/Users/pbeshai/tmproot/");
       configuration.add("tapestry.supported-locales", "en");
       configuration.add("tapestry.start-page-name", "Login");
   }


And hopefully be able to inject that value into components where
necessary. Is there a more advised way of doing this?

Unfortunately, I am unable to retrieve this value in my component
(from simple lack of know-how).

I thought it might be similar to
@Inject
@Value("${tutor.file-system-root}")
private String _fileSystemRoot;


public String getFileSystemRoot() { return _fileSystemRoot; }


發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章