While less invasive, the drawback of that approach is that it requires explicit declaration of 'init-method' and/or 'destroy-method' attributes on the 'bean' element.
尽管入侵性小,但缺点在于使用这个方式的话就必须显式声明bean元素的init-method或destroy-method属性。
Init : This method is called when the filter is instantiated by the container and is designed to prep the filter for processing.
init:这个方法在容器实例化过滤器时被调用,它主要设计用于使过滤器为处理做准备。
The engine will automatically construct a new instance of the object then call the init method on that object, so that the object has a chance to initialize itself from the context object.
这个引擎将自动地为该对象构造的一个新的实例,然后调用其init方法,以便该对象能够有机会根据上下文对象对自己进行初始化。
In Listing 9, the BrowserModel class performs its initialization within the init method.
在清单9中,browsermodel类在init方法中执行自己的初始化。
This is set up in its own thread during the init method of the servlet and taken down in the destroy method of the servlet.
这个类的实例是在servlet的init方法中在其自身的线程中创建,并在servlet的destroy方法中销毁的。
The following code shows an example adapting Run to IConfigurable using the init(String) method
下面的代码给出了一个例子,用init(String) 方法使Run适应于 IConfigurable
The init method initializes a set of parameters for the servlet instance.
这个init方法为Servlet实例初始化了一套参数。
The next step is to initiate the cipher object by calling its init method.
下一步是调用cipher对象的init方法初始化这个对象。
When those three additional parameters are uncommented, the logic related to this architecture will be invoked in the servlet's init method.
如果这三个附加的参数没有注释掉,在与此体系结构有关的逻辑将通过该Servlet的init方法进行调用。
Therefore the suggested programming practice is to look up the service in the init method of the portlet and store it in an instance variable.
因此,建议的编程实践是在Portlet的init方法中查找服务,并将其存储在一个实例变量中。
Because the DataFactory class implements the ServletContextListener interface, it guarantees that its init method is called when the servlet context is first created.
因为DataFactory类实现了ServletContextListener接口,所以可以保证在第一次创建servlet上下文时调用其init方法。
Because the JNDI lookup can be expensive, it is good practice to store the provider object as a member variable of the portlet, and to initialize it in the init method.
因为JNDI查找开销非常大,所以最好的做法是将提供程序对象存储为Portlet的成员变量,并在init方法中对其初始化。
For example, in the init method of a Web service client servlet, you could set the endpoint for the service proxy.
例如,在Web服务客户端Servlet的init方法中,您可以为服务代理设置端点。
Much of that is because the test program is set up in a way that is pretty modular—with a constructor and init() method—so you can easily reuse this code for your own purposes without lots of changes.
主要是因为该测试程序按照非常模块化的方法编写 —使用构造函数init()方法 —以便不需要很大修改就能用于您自己的程序。
Calls the super class init method.
调用超类的init方法。
We've refactored the large amount of code in the constructor to put it in an init method, which still will be called by default in the constructor to avoid breaking any existing code.
我们重构了构造函数中大量的代码,将它们移到一个init方法中,这个方法默认情况下仍然会被构造函数调用,以避免破坏现有代码的逻辑。
Initializing the portlet and putting it into service (init method).
初始化portlet并将其放入服务中(init方法)。
In wicket framework, web pages can be mounted in init method of the main application class, which has to inherit from org.apache.wicket.protocol.http.WebApplication.
wicket框架中,主应用类必须继承org . apache . wicket . protocol . http . WebApplication,Web页面可以在主应用类的init方法中进行装载。
The method that is called when a servlet is loaded for the first time by the servlet container is the init method.
当servlet容器第一次装载一个 servlet 时,将调用 init方法。
My init method is neither static nor public.
我的init方法既不是static,也不是public。
Its init method (see Listing 10) gets several configuration parameters and creates a ScriptCache object.
其init方法(参见清单10)会获得几个配置参数并创建一个ScriptCache对象。
Within the init method of the portlet, retrieve the set of necessary services.
在Portlet的init方法中,检索所需服务的集合。
In the init method we instantiate a thread that gets the stock quotes and writes it to all the clients that are listening, i.e all the response objects in the openConnections list.
在init方法中,我们将实例化获取股票报价的线程,此线程还要将这些报价写入所有正在侦听的客户端,即openconnections列表中的所有响应对象。
However, now we can just pass a Boolean false to the constructor during our tests to avoid calling the init method and all the unneeded initialization logic.
然而,现在我们在测试过程中只能够传递一个布尔值false给构造函数,以避免调用init方法和所有不必要的初始化逻辑。
This code is included in the init method of the sample portlet (see Listing 1).
示例Portlet的init方法中包括以下代码(参见清单1)。
You can use the init method to read parameters from the PortletServiceRegistryService.properties file, and to initialize any required Settings.
您可以使用init方法从PortletServiceRegistryService . properties文件中读取参数,初始化任何必需的设置。
The Log object could require its own initialization, to be performed by an init() instance method.
Log对象可以要求其自己的、由init()实例方法执行的初始化。
Although not shown in this example, it is also possible to modify the StyleBean class so that the init method could open the appropriate CSS, instead of referencing the properties resource bundle.
尽管这个示例中没显示,但修改stylebean类,从而使init方法可以打开恰当的CSS,而不必引用属性资源束,这也是可能的。
This also requires a modification to the init method to accept a String context.
这也需要对init方法进行修改以便能够接受String上下文。
During the init method, store information used by the getter methods (like the user name) using instance variables on the application object or using WebSphere Dynamic Cache maps.
在init方法中,使用应用程序对象中的实例变量或WebSphereDynamicCache映射来存储getter方法所使用的信息(比如用户名)。
应用推荐