亚洲在线久爱草,狠狠天天香蕉网,天天搞日日干久草,伊人亚洲日本欧美

為了賬號安全,請及時綁定郵箱和手機立即綁定
已解決430363個問題,去搜搜看,總會有你想問的

將bean xml轉換為spring boot注解

將bean xml轉換為spring boot注解

元芳怎么了 2021-09-26 18:08:45
ProcessBuilder的構造函數接受一個命令,每個后續的 String 都被視為第一個 String 的參數,被識別為主命令。嘗試更換/bin/bash用pandoc,看看它是否工作。在我這邊,我可以在沒有 ProcessBuilder 幫助的情況下運行任意命令,Runtime.getRuntime().exec(...)而是使用,如下所示:public static void main(String[] args) throws Exception {    Process proc = Runtime.getRuntime().exec("cmd /c ipconfig");    BufferedReader reader = new BufferedReader(new InputStreamReader(proc.getInputStream()));    String line = null;    while((line = reader.readLine()) != null){        System.out.println(line);    }}獲得預期輸出:Configurazione IP di WindowsScheda Ethernet Ethernet:   Suffisso DNS specifico per connessione:    Indirizzo IPv6 locale rispetto al collegamento . : fe80::fcba:735a:5941:5cdc%11   Indirizzo IPv4. . . . . . . . . . . . : 192.168.0.116   Subnet mask . . . . . . . . . . . . . : 255.255.255.0   Gateway predefinito . . . . . . . . . : 192.168.0.1Process finished with exit code 0如果你真的需要使用ProcessBuilder,同樣的行為可以通過定義你的Process方式來實現:Process proc = new ProcessBuilder("ipconfig").start();只需調用您要運行的命令即可。我有來自 spring 框架的以下 bean xml?,F在我們正在使用所有注釋轉移到 spring boot。如何將以下 bean 轉換為注釋?<bean id="testPool" class="com.v1.testPoolImpl" init-method="init" destroy-method="shutdown">    <property name="configurations">        <bean class="org.springframework.beans.factory.config.PropertiesFactoryBean">            <property name="location" value="classpath:database.properties"/>        </bean>    </property></bean>com.v1.testPoolImpl(是其他一些庫)
查看完整描述

3 回答

  • 3 回答
  • 0 關注
  • 441 瀏覽
慕課專欄
更多

添加回答

舉報

0/150
提交
取消
微信客服

購課補貼
聯系客服咨詢優惠詳情

幫助反饋 APP下載

慕課網APP
您的移動學習伙伴

公眾號

掃描二維碼
關注慕課網微信公眾號