|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: REQUIRED | OPTIONAL | DETAIL: ELEMENT |
@Documented @Retention(value=RUNTIME) @Target(value={CONSTRUCTOR,FIELD,METHOD}) public @interface Inject
Designates fields, methods and constructors as injectable. Injectable can
have any access qualifier (private, package-private, protected or public).
It applies to static or instance members. The order of resolving injectable
is as following:
package example;
import javax.servlet.*;
import java.io.*;
import javax.inject.*;
public class MyServlet extends GenericServlet {
@Inject MyBean _bean;
public void service(ServletRequest req, ServletResponse res)
throws IOException
{
PrintWriter out = res.getWriter();
out.println("my-bean: " + _bean);
}
}
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: REQUIRED | OPTIONAL | DETAIL: ELEMENT |