3

私はこのようにSpringアプリケーションを設定web.xmlすることを宣言しています:ContextLoaderListener

<listener>    
   <listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>    
</listener>

Spring 構成 xml ファイルの 1 つで、開発用と本番用に異なるBean プロファイルを使用しています。

<beans profile="production">
   <bean />
</beans
<beans profile="development">
   <bean />
</beans

でデフォルトの Bean プロファイルを設定するにはどうすればよいweb.xmlですか? ContextLoaderListener春のサーブレットの代わりに使用する場合、次のようなものがありますか?

<init-param>
   <param-name>spring.profiles.active</param-name>
   <param-value>production</param-value>
</init-param>
4

1 に答える 1