Spring, IOC mode and EJB3 SLSB implementation

xiaoxiao2021-03-06  69

Let's take a look at the implementation of EJB3 SLSB: Import Javax.ejb.Stateless; @StateLesSpublic Class Hellobean {private string_greeting = "default hello";

Public void setgreeting (string greeting) {_greeting = Greeting;

Public string hello () {return _greeting;}}

Then we look at the configuration method in XML: What did we see? The configuration file passed "Hello, World" to setgreeting as a parameter. Of course, the EJB implementation generates a Hello interface according to the default value; the interface method is implemented, straight

Toned Return_Greeting; Is the IOC mode

Type2. It can be seen that the IOC mode used by EJB3 is similar to the IOC used by Spring. It has used Spring, and it is also a very good pavement for us to learn EJB3 later.

转载请注明原文地址:https://www.9cbs.com/read-118818.html

New Post(0)