Let's take a look at how to call EJB3: public class helloservlet extends genericservlet {private hello_hello;
Public void sethello (hello hello) {_hello = hello;
public void service (HttpServletRequest req, HttpServletResponse res) throws IOException, ServletException {PrintWriter out = res.getWriter (); out.println (_hello.hello ());}} We then look at the configuration xml:
Now he is a Hello interface; in service, directly call _hello.hello (), actually calling Hellobean
Hello () method is implemented. Oh, pass the needs of the Hellobean to the servlet, if our needs have changed,
New Hello2Bean implementation, we only need to modify in the configuration file, this is the IOC mode
The Type2.Spring framework is also type2 IOC mode, such as the Spring profile as follows:
PRIVATE STUDENT;
Public void setstudent (student student) {this.student = student;} // write paper method public void writepaper () {student.writepaper ();}}, if you want to write IOC's papers, find a master of IOC students Write; if you want to write BPEL's papers, find one
Writing BPEL's student writing, places to modify, that is, configuration files.