????3.?????????applicationContext.xml????????????
????a.??????????bean
????<bean id="studentService" class="service.StudentServiceImpl"></bean>
????b.???嵼??????
????<bean class="org.springframework.remoting.rmi.RmiServiceExporter"
????p:service-ref="studentService"
????p:serviceInterface="service.StudentService"
????p:serviceName="StudentService"
????p:registryPort="5008"
????/>
?????????????p:registryHost????????????
????c.???????applicationContext.xml?ж??????????bean(???????????????????bean???????bean???????applicationContext.xml?е?)
????<bean id="getStudentService"
????class="org.springframework.remoting.rmi.RmiProxyFactoryBean"
????p:serviceUrl="rmi://127.0.0.1:5008/StudentService"
????p:serviceInterface="service.StudentService"
????/>
????d.??????????????????????????????????????????????????????
1 package service;
2 import java.util.List;
3 import org.springframework.context.ApplicationContext;
4 import org.springframework.context.support.ClassPathXmlApplicationContext;
5 public class Test {
6 public static void main(String[] args) {
7   ApplicationContext ctx=new ClassPathXmlApplicationContext("applicationContext.xml");
8   StudentService studentService=(StudentService) ctx.getBean("getStudentService");
9   List<Student> list = studentService.getList();
10   for (Student s : list) {
11    System.out.println("??????"+s.getName()+"??????"+s.getAge());
12   }
13  }
14 }
????=============?????============
????????????????????15
???????????????????20
????=============================
?????????mian???????п????????????spring??jar???????????????