main
parent
f2550bf11c
commit
3425b54711
@ -0,0 +1,6 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<beans xmlns="http://www.springframework.org/schema/beans"
|
||||
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>
|
@ -0,0 +1,40 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<beans xmlns="http://www.springframework.org/schema/beans"
|
||||
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">
|
||||
<bean id="movie" class="com.ssm.di.xml.Movie">
|
||||
<property name="id" value="1"/>
|
||||
<property name="name" value="Avengers: Endgame"/>
|
||||
<property name="director" value="Anthony Russo, Joe Russo"/>
|
||||
<property name="genre" value="Action, Adventure, Sci-Fi"/>
|
||||
<property name="duration" value="181"/>
|
||||
</bean>
|
||||
<bean id="announcement" class="com.ssm.di.xml.Announcement">
|
||||
<property name="id" value="1"/>
|
||||
<property name="title" value="New Movie Release"/>
|
||||
<property name="content" value="A new movie is coming soon!"/>
|
||||
<property name="publishDate" value="2025-03-10"/>
|
||||
<property name="publisher" value="Admin"/>
|
||||
</bean>
|
||||
<bean id="tag" class="com.ssm.di.xml.Tag">
|
||||
<property name="id" value="1"/>
|
||||
<property name="name" value="Action"/>
|
||||
<property name="description" value="Movies with a lot of action scenes"/>
|
||||
<property name="createDate" value="2025-03-10"/>
|
||||
<property name="status" value="1"/>
|
||||
</bean>
|
||||
<bean id="showSchedule" class="com.ssm.di.xml.ShowSchedule">
|
||||
<property name="id" value="1"/>
|
||||
<property name="movieId" value="1"/>
|
||||
<property name="screeningRoomId" value="1"/>
|
||||
<property name="startTime" value="2025-03-10"/>
|
||||
<property name="endTime" value="2025-03-11"/>
|
||||
</bean>
|
||||
<bean id="screeningRoom" class="com.ssm.di.xml.ScreeningRoom">
|
||||
<property name="id" value="1"/>
|
||||
<property name="name" value="Hall 1"/>
|
||||
<property name="capacity" value="200"/>
|
||||
<property name="type" value="2D"/>
|
||||
<property name="status" value="Available"/>
|
||||
</bean>
|
||||
</beans>
|
@ -0,0 +1,8 @@
|
||||
package com.ssm.aop.annotation;
|
||||
|
||||
public class TestAnnotation {
|
||||
public static void main(String[] args) {
|
||||
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,9 @@
|
||||
package com.ssm.aop.xml;
|
||||
|
||||
|
||||
public class TestXML {
|
||||
|
||||
public static void main(String[] args) {
|
||||
|
||||
}
|
||||
}
|
@ -0,0 +1,9 @@
|
||||
package com.ssm.di.annotation;
|
||||
|
||||
public class TestAnnotation {
|
||||
|
||||
public static void main(String[] args) {
|
||||
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,4 @@
|
||||
package com.ssm.di.xml;
|
||||
|
||||
public class TextNEW {
|
||||
}
|
@ -0,0 +1,25 @@
|
||||
package com.ssm.di.xml;
|
||||
|
||||
import org.springframework.context.ApplicationContext;
|
||||
import org.springframework.context.support.ClassPathXmlApplicationContext;
|
||||
|
||||
public class TextXML {
|
||||
public static void main(String[] args) {
|
||||
ApplicationContext context = new ClassPathXmlApplicationContext("bean-ioc.xml");
|
||||
|
||||
Movie movie = (Movie) context.getBean("movie");
|
||||
System.out.println(movie.toString());
|
||||
|
||||
Announcement announcement = (Announcement) context.getBean("announcement");
|
||||
System.out.println(announcement.toString());
|
||||
|
||||
Tag tag = (Tag) context.getBean("tag");
|
||||
System.out.println(tag.toString());
|
||||
|
||||
ShowSchedule showSchedule = (ShowSchedule) context.getBean("showSchedule");
|
||||
System.out.println(showSchedule.toString());
|
||||
|
||||
ScreeningRoom screeningRoom = (ScreeningRoom) context.getBean("screeningRoom");
|
||||
System.out.println(screeningRoom.toString());
|
||||
}
|
||||
}
|
@ -0,0 +1,16 @@
|
||||
package com.ssm.first;
|
||||
|
||||
|
||||
import org.springframework.context.ApplicationContext;
|
||||
import org.springframework.context.support.ClassPathXmlApplicationContext;
|
||||
|
||||
public class TestFirst {
|
||||
public static void main(String[] args) {
|
||||
ApplicationContext ac=new ClassPathXmlApplicationContext("bean-first.xml");
|
||||
System.out.print("Hello and welcome!");
|
||||
System.out.print("Hello and welcome! hjb");
|
||||
System.out.print("Hello and welcome! yuleyuan");
|
||||
System.out.print("Hello and welcome! lvk");
|
||||
System.out.print("Hello and welcome! yq");
|
||||
}
|
||||
}
|
Loading…
Reference in new issue