spring-el

    0熱度

    1回答

    我希望能夠做的是: YAML: features: feature1: true feature2: false feature3: true 代碼: @Value("${features}") private Map<String,Boolean> features; 我無法弄清楚使用什麼Spring腳本語法來完成此操作(如果可能的話)

    0熱度

    1回答

    我使用的是Spring批處理2.1.9,並且需要用一些文本和運行日期用#符號分隔來編寫文件名。不幸的是我無法找到一種方式來顯示#號而不會破壞表達式。我曾嘗試以下格式,都無濟於事:額外的英鎊符號包括 File##{jobParameters[rundate]} File#{'#' + jobParameters[rundate]} File${'#'}#{jobParameters[rund

    2熱度

    1回答

    我想補充一個個:文本選擇選項(Thymeleaf), <option th:each="case : ${caseCategoryList}" th:value="${case.caseCategoryId}" th:text="${case.caseCategoryName} - ${case.caseCategoryCode}"></option> ,但我得到這個錯誤 08:28:05,5

    2熱度

    1回答

    我正在與春天和百里香一起工作。 我需要從當前的URL中移除一個參數,我做這樣的考慮: urlBuilder=${T(org.springframework.web.servlet.support.ServletUriComponentsBuilder).fromCurrentRequest()}, currentUrl=${urlBuilder.replaceQueryParam('page',

    0熱度

    1回答

    我試圖避免與傳遞第二個參數法列表大小的冗餘。相反,我使用EL,但我有一個錯誤: org.hibernate.QueryException: Not all named parameters have been set: [$synthetic$__1] [SELECT distinct b FROM Book b join b.bookHashtags as ht where ht.hashtag

    0熱度

    1回答

    我試圖配置基於應用屬性的Spring bean,我的最終目標是在下面的僞代碼來描述: if ${my.config} <bean id="myBean" class="path.to.MyBeanImplOne" /> else <bean id="myBean" class="path.to.MyBeanImplTwo" /> end 其中my.config是一個布爾

    1熱度

    2回答

    我有這個值的春天啓動配置文件: @Value("#{new Integer('${db.pool.size}')}") private Integer dbPoolSize; @Value("#{new Integer('${db.minimum.idle}')}") private Integer dbMinimumIdle; 但是,當我開始我得到這個錯誤的應用程序: Caused

    0熱度

    1回答

    我想動態配置上的createIndex標誌: @Document(indexName = "#{@myindex}", createIndex = "#{@shouldIndex}") public class MyDocument { ... } 這將引發一個錯誤,因爲預計的createIndex布爾。有什麼辦法從EL表達式返回布爾類型?

    2熱度

    1回答

    長話短說: 有沒有辦法解釋從${my.property}爲@Value註釋內的規劃環境地政司的表達而產生,而不使用字符串轉換器,例如像@Value("#{${my.property}})? 我有一個抽象工廠(簡體),讓我建立這是我的系統的配置的一部分,一些常見的物品。 @Component public class Factory { public Product makeVal(in

    1熱度

    1回答

    當使用Spring Integration的SFTP會話工廠(使用Java配置)時,我想動態設置遠程SFTP服務器目錄。 Spring的文檔說,這是可能的: Spring Integration SFTP Adapters 規劃環境地政司和SFTP出站適配器 如同在Spring集成許多其他組件,您可以從Spring表達式語言受益 (通過指定兩個屬性 remote-directory-express