Skip to content

Commit 18c0861

Browse files
committed
properties types added
1 parent 38936b8 commit 18c0861

File tree

7 files changed

+98
-1
lines changed

7 files changed

+98
-1
lines changed
+14
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
package com.springcore1.collections.props;
2+
3+
import org.springframework.context.ApplicationContext;
4+
import org.springframework.context.support.ClassPathXmlApplicationContext;
5+
6+
public class App {
7+
public static void main(String[] args) {
8+
ApplicationContext context = new ClassPathXmlApplicationContext("com/springcore1/collections/props/config.xml");
9+
User user=(User) context.getBean("nameShikhar");
10+
System.out.println(user.getProperties());
11+
12+
}
13+
14+
}
+27
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
package com.springcore1.collections.props;
2+
3+
import java.util.Properties;
4+
5+
public class User {
6+
private Properties properties;
7+
8+
public Properties getProperties() {
9+
return properties;
10+
}
11+
12+
public void setProperties(Properties properties) {
13+
this.properties = properties;
14+
}
15+
16+
public User(Properties properties) {
17+
super();
18+
this.properties = properties;
19+
}
20+
21+
public User() {
22+
super();
23+
// TODO Auto-generated constructor stub
24+
}
25+
26+
27+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<beans xmlns="http://www.springframework.org/schema/beans"
3+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
4+
xmlns:context="http://www.springframework.org/schema/context"
5+
xmlns:p="http://www.springframework.org/schema/p"
6+
xsi:schemaLocation="http://www.springframework.org/schema/beans
7+
http://www.springframework.org/schema/beans/spring-beans.xsd
8+
http://www.springframework.org/schema/context
9+
http://www.springframework.org/schema/context/spring-context.xsd" >
10+
11+
12+
13+
<bean class="com.springcore1.collections.props.User" name="nameShikhar">
14+
15+
<property name="properties">
16+
<props>
17+
<prop key="username">cratesium</prop>
18+
<prop key="password">*********</prop>
19+
20+
21+
</props>
22+
23+
24+
</property>
25+
</bean>
26+
27+
28+
</beans>

Diff for: target/classes/META-INF/maven/com.springcore/springcore/pom.properties

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#Generated by Maven Integration for Eclipse
2-
#Sat Aug 10 00:57:07 IST 2024
2+
#Sat Aug 10 01:03:27 IST 2024
33
artifactId=springcore
44
groupId=com.springcore
55
m2e.projectLocation=/Volumes/project/LearningSpring/springcore1
1.08 KB
Binary file not shown.
673 Bytes
Binary file not shown.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<beans xmlns="http://www.springframework.org/schema/beans"
3+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
4+
xmlns:context="http://www.springframework.org/schema/context"
5+
xmlns:p="http://www.springframework.org/schema/p"
6+
xsi:schemaLocation="http://www.springframework.org/schema/beans
7+
http://www.springframework.org/schema/beans/spring-beans.xsd
8+
http://www.springframework.org/schema/context
9+
http://www.springframework.org/schema/context/spring-context.xsd" >
10+
11+
12+
13+
<bean class="com.springcore1.collections.props.User" name="nameShikhar">
14+
15+
<property name="properties">
16+
<props>
17+
<prop key="username">cratesium</prop>
18+
<prop key="password">*********</prop>
19+
20+
21+
</props>
22+
23+
24+
</property>
25+
</bean>
26+
27+
28+
</beans>

0 commit comments

Comments
 (0)