[春のメモ]cスペースとp名前空間の注入

p名前空間インジェクション:

Springのp名前空間は、setメソッドを使用して、プロパティコンテンツをより便利に挿入することです。

 p-spaceをインポートする必要があるxml制約

xmlns:p="http://www.springframework.org/schema/p"

 試験結果:

c名前空間:

Springのc名前空間は、パラメーター化されたコンストラクターインジェクションをより便利に使用するためのものです。

最初に行うことは、c名前空間にxml制約を導入することです

<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
       xmlns:c="http://www.springframework.org/schema/c"
       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
       xsi:schemaLocation="http://www.springframework.org/schema/beans
       http://www.springframework.org/schema/beans/spring-beans.xsd">
</beans>

 

 試験結果

 

 

おすすめ

転載: blog.csdn.net/m0_52043808/article/details/124387292