File tree 17 files changed +363
-0
lines changed
main/java/com/springcore1
test/java/com/springcore1
maven/com.springcore/springcore
test-classes/com/springcore1
17 files changed +363
-0
lines changed Original file line number Diff line number Diff line change
1
+ <?xml version =" 1.0" encoding =" UTF-8" ?>
2
+ <classpath >
3
+ <classpathentry kind =" src" output =" target/classes" path =" src/main/java" >
4
+ <attributes >
5
+ <attribute name =" optional" value =" true" />
6
+ <attribute name =" maven.pomderived" value =" true" />
7
+ </attributes >
8
+ </classpathentry >
9
+ <classpathentry excluding =" **" kind =" src" output =" target/classes" path =" src/main/resources" >
10
+ <attributes >
11
+ <attribute name =" maven.pomderived" value =" true" />
12
+ <attribute name =" optional" value =" true" />
13
+ </attributes >
14
+ </classpathentry >
15
+ <classpathentry kind =" src" output =" target/test-classes" path =" src/test/java" >
16
+ <attributes >
17
+ <attribute name =" optional" value =" true" />
18
+ <attribute name =" maven.pomderived" value =" true" />
19
+ <attribute name =" test" value =" true" />
20
+ </attributes >
21
+ </classpathentry >
22
+ <classpathentry excluding =" **" kind =" src" output =" target/test-classes" path =" src/test/resources" >
23
+ <attributes >
24
+ <attribute name =" maven.pomderived" value =" true" />
25
+ <attribute name =" test" value =" true" />
26
+ <attribute name =" optional" value =" true" />
27
+ </attributes >
28
+ </classpathentry >
29
+ <classpathentry kind =" con" path =" org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8" >
30
+ <attributes >
31
+ <attribute name =" maven.pomderived" value =" true" />
32
+ </attributes >
33
+ </classpathentry >
34
+ <classpathentry kind =" con" path =" org.eclipse.m2e.MAVEN2_CLASSPATH_CONTAINER" >
35
+ <attributes >
36
+ <attribute name =" maven.pomderived" value =" true" />
37
+ </attributes >
38
+ </classpathentry >
39
+ <classpathentry kind =" output" path =" target/classes" />
40
+ </classpath >
Original file line number Diff line number Diff line change
1
+ <?xml version =" 1.0" encoding =" UTF-8" ?>
2
+ <projectDescription >
3
+ <name >springcore1</name >
4
+ <comment ></comment >
5
+ <projects >
6
+ </projects >
7
+ <buildSpec >
8
+ <buildCommand >
9
+ <name >org.eclipse.jdt.core.javabuilder</name >
10
+ <arguments >
11
+ </arguments >
12
+ </buildCommand >
13
+ <buildCommand >
14
+ <name >org.eclipse.m2e.core.maven2Builder</name >
15
+ <arguments >
16
+ </arguments >
17
+ </buildCommand >
18
+ </buildSpec >
19
+ <natures >
20
+ <nature >org.eclipse.jdt.core.javanature</nature >
21
+ <nature >org.eclipse.m2e.core.maven2Nature</nature >
22
+ </natures >
23
+ </projectDescription >
Original file line number Diff line number Diff line change
1
+ eclipse.preferences.version =1
2
+ encoding//src/main/java =UTF-8
3
+ encoding//src/test/java =UTF-8
4
+ encoding/<project>=UTF-8
Original file line number Diff line number Diff line change
1
+ eclipse.preferences.version =1
2
+ org.eclipse.jdt.core.compiler.codegen.targetPlatform =1.8
3
+ org.eclipse.jdt.core.compiler.compliance =1.8
4
+ org.eclipse.jdt.core.compiler.problem.enablePreviewFeatures =disabled
5
+ org.eclipse.jdt.core.compiler.problem.forbiddenReference =warning
6
+ org.eclipse.jdt.core.compiler.problem.reportPreviewFeatures =ignore
7
+ org.eclipse.jdt.core.compiler.release =disabled
8
+ org.eclipse.jdt.core.compiler.source =1.8
Original file line number Diff line number Diff line change
1
+ activeProfiles =
2
+ eclipse.preferences.version =1
3
+ resolveWorkspaceProjects =true
4
+ version =1
Original file line number Diff line number Diff line change
1
+ <project xmlns =" http://maven.apache.org/POM/4.0.0" xmlns : xsi =" http://www.w3.org/2001/XMLSchema-instance"
2
+ xsi : schemaLocation =" http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd" >
3
+ <modelVersion >4.0.0</modelVersion >
4
+
5
+ <groupId >com.springcore</groupId >
6
+ <artifactId >springcore</artifactId >
7
+ <version >0.0.1-SNAPSHOT</version >
8
+ <packaging >jar</packaging >
9
+
10
+ <name >springcore</name >
11
+ <url >http://maven.apache.org</url >
12
+
13
+ <properties >
14
+ <project .build.sourceEncoding>UTF-8</project .build.sourceEncoding>
15
+ </properties >
16
+
17
+ <dependencies >
18
+
19
+ <!-- https://mvnrepository.com/artifact/org.springframework/spring-core -->
20
+ <dependency >
21
+ <groupId >org.springframework</groupId >
22
+ <artifactId >spring-core</artifactId >
23
+ <version >5.3.19</version >
24
+ </dependency >
25
+
26
+ <!-- https://mvnrepository.com/artifact/org.springframework/spring-context -->
27
+ <dependency >
28
+ <groupId >org.springframework</groupId >
29
+ <artifactId >spring-context</artifactId >
30
+ <version >5.3.19</version >
31
+ </dependency >
32
+
33
+
34
+ <dependency >
35
+ <groupId >javax.annotation</groupId >
36
+ <artifactId >javax.annotation-api</artifactId >
37
+ <version >1.3.2</version >
38
+ </dependency >
39
+
40
+ <dependency >
41
+ <groupId >junit</groupId >
42
+ <artifactId >junit</artifactId >
43
+ <version >3.8.1</version >
44
+ <scope >test</scope >
45
+ </dependency >
46
+ </dependencies >
47
+ </project >
Original file line number Diff line number Diff line change
1
+ package com .springcore1 ;
2
+ import org .springframework .context .ApplicationContext ;
3
+ import org .springframework .context .support .ClassPathXmlApplicationContext ;
4
+ public class App
5
+ {
6
+ public static void main ( String [] args )
7
+ {
8
+ // ApplicationContext context = new ClassPathXmlApplicationContext("com/springcore1/config.xml");
9
+ ApplicationContext context = new ClassPathXmlApplicationContext ("com/springcore1/config.xml" );
10
+
11
+ Student student1 = (Student )context .getBean ("student1" );
12
+ System .out .println (student1 );
13
+ // Student student2 = (Student)context.getBean("student2");
14
+ // System.out.println(student2);
15
+
16
+ }
17
+
18
+ }
Original file line number Diff line number Diff line change
1
+ package com .springcore1 ;
2
+
3
+ public class Student {
4
+ private int studentId ;
5
+ private String studentName ;
6
+ private String studentAddress ;
7
+ public int getStudentId () {
8
+ return studentId ;
9
+ }
10
+ public void setStudentId (int studentId ) {
11
+ System .out .println ("Setting std id" );
12
+ this .studentId = studentId ;
13
+ }
14
+ public String getStudentName () {
15
+ return studentName ;
16
+ }
17
+ public void setStudentName (String studentName ) {
18
+ System .out .println ("Setting std name" );
19
+ this .studentName = studentName ;
20
+ }
21
+ public String getStudentAddress () {
22
+ return studentAddress ;
23
+ }
24
+ public void setStudentAddress (String studentAddress ) {
25
+ this .studentAddress = studentAddress ;
26
+ }
27
+ public Student (int studentId , String studentName , String studentAddress ) {
28
+ super ();
29
+ this .studentId = studentId ;
30
+ this .studentName = studentName ;
31
+ this .studentAddress = studentAddress ;
32
+ }
33
+ public Student () {
34
+ super ();
35
+ // TODO Auto-generated constructor stub
36
+ }
37
+ @ Override
38
+ public String toString () {
39
+ return "Student [studentId=" + studentId + ", studentName=" + studentName + ", studentAddress=" + studentAddress
40
+ + "]" ;
41
+ }
42
+
43
+ }
Original file line number Diff line number Diff line change
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
+
14
+
15
+
16
+ <!-- using value attribute -->
17
+
18
+ <!--
19
+ <bean class="com.springcore1.Student" name ="student1">
20
+
21
+ <property name ="studentId" value="12"/>
22
+ <property name="studentName" value="Shikhar Pratap Singh " />
23
+ <property name="studentAddress" value ="Noida"/>
24
+ </bean>
25
+ -->
26
+
27
+ <!-- <bean class="com.springcore1.Student" name ="student2">
28
+
29
+ <property name ="studentId" value="2"/>
30
+ <property name="studentName" value="Shikhar Singh " />
31
+ <property name="studentAddress" value ="Noida NCR "/>
32
+ </bean> -->
33
+
34
+ <!-- using value and property element -->
35
+ <bean class =" com.springcore1.Student" name =" student1" p : studentId =" 121" p : studentName =" jai prakash mehta " p : studentAddress =" noida-ext" />
36
+
37
+
38
+
39
+
40
+ </beans >
Original file line number Diff line number Diff line change
1
+ package com .springcore1 ;
2
+
3
+ import junit .framework .Test ;
4
+ import junit .framework .TestCase ;
5
+ import junit .framework .TestSuite ;
6
+
7
+ /**
8
+ * Unit test for simple App.
9
+ */
10
+ public class AppTest
11
+ extends TestCase
12
+ {
13
+ /**
14
+ * Create the test case
15
+ *
16
+ * @param testName name of the test case
17
+ */
18
+ public AppTest ( String testName )
19
+ {
20
+ super ( testName );
21
+ }
22
+
23
+ /**
24
+ * @return the suite of tests being tested
25
+ */
26
+ public static Test suite ()
27
+ {
28
+ return new TestSuite ( AppTest .class );
29
+ }
30
+
31
+ /**
32
+ * Rigourous Test :-)
33
+ */
34
+ public void testApp ()
35
+ {
36
+ assertTrue ( true );
37
+ }
38
+ }
Original file line number Diff line number Diff line change
1
+ Manifest-Version : 1.0
2
+ Build-Jdk-Spec : 21
3
+ Created-By : Maven Integration for Eclipse
4
+
Original file line number Diff line number Diff line change
1
+ # Generated by Maven Integration for Eclipse
2
+ # Thu Aug 08 22:56:14 IST 2024
3
+ artifactId =springcore
4
+ groupId =com.springcore
5
+ m2e.projectLocation =/Volumes/project/LearningSpring/springcore1
6
+ m2e.projectName =springcore1
7
+ version =0.0.1-SNAPSHOT
Original file line number Diff line number Diff line change
1
+ <project xmlns =" http://maven.apache.org/POM/4.0.0" xmlns : xsi =" http://www.w3.org/2001/XMLSchema-instance"
2
+ xsi : schemaLocation =" http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd" >
3
+ <modelVersion >4.0.0</modelVersion >
4
+
5
+ <groupId >com.springcore</groupId >
6
+ <artifactId >springcore</artifactId >
7
+ <version >0.0.1-SNAPSHOT</version >
8
+ <packaging >jar</packaging >
9
+
10
+ <name >springcore</name >
11
+ <url >http://maven.apache.org</url >
12
+
13
+ <properties >
14
+ <project .build.sourceEncoding>UTF-8</project .build.sourceEncoding>
15
+ </properties >
16
+
17
+ <dependencies >
18
+
19
+ <!-- https://mvnrepository.com/artifact/org.springframework/spring-core -->
20
+ <dependency >
21
+ <groupId >org.springframework</groupId >
22
+ <artifactId >spring-core</artifactId >
23
+ <version >5.3.19</version >
24
+ </dependency >
25
+
26
+ <!-- https://mvnrepository.com/artifact/org.springframework/spring-context -->
27
+ <dependency >
28
+ <groupId >org.springframework</groupId >
29
+ <artifactId >spring-context</artifactId >
30
+ <version >5.3.19</version >
31
+ </dependency >
32
+
33
+
34
+ <dependency >
35
+ <groupId >javax.annotation</groupId >
36
+ <artifactId >javax.annotation-api</artifactId >
37
+ <version >1.3.2</version >
38
+ </dependency >
39
+
40
+ <dependency >
41
+ <groupId >junit</groupId >
42
+ <artifactId >junit</artifactId >
43
+ <version >3.8.1</version >
44
+ <scope >test</scope >
45
+ </dependency >
46
+ </dependencies >
47
+ </project >
Original file line number Diff line number Diff line change
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
+
14
+
15
+
16
+ <!-- using value attribute -->
17
+
18
+ <!--
19
+ <bean class="com.springcore1.Student" name ="student1">
20
+
21
+ <property name ="studentId" value="12"/>
22
+ <property name="studentName" value="Shikhar Pratap Singh " />
23
+ <property name="studentAddress" value ="Noida"/>
24
+ </bean>
25
+ -->
26
+
27
+ <!-- <bean class="com.springcore1.Student" name ="student2">
28
+
29
+ <property name ="studentId" value="2"/>
30
+ <property name="studentName" value="Shikhar Singh " />
31
+ <property name="studentAddress" value ="Noida NCR "/>
32
+ </bean> -->
33
+
34
+ <!-- using value and property element -->
35
+ <bean class =" com.springcore1.Student" name =" student1" p : studentId =" 121" p : studentName =" jai prakash mehta " p : studentAddress =" noida-ext" />
36
+
37
+
38
+
39
+
40
+ </beans >
You can’t perform that action at this time.
0 commit comments