Search |
||||||
Roger Kitain's blogContext And Dependency Injection (JSR 299) And ServletsPosted by rogerk on September 9, 2009 at 7:34 AM PDT
I've had questions about how to inject Web Beans into servlets and whether that is supported. In this entry I'll outline a method of accomplishing just that. Listing 1: Login Credentials
Listing 2: Login
Listing 3: Login Servlet
This is just one example of Web Bean injection into a servlet. There are more areas in the JavaEE6 platform that can be used as Web Bean injection points - topics that will certainly be covered in future posts. The sample for this blog can be found under the glassfish-samples project. You can check out the code following these instructions. Once the workspace is checked out, you can find this sample under glassfish-samples/ws/javaee6/webbeans/webbeans-servlet. You can find documentation for the sample under glassfish-samples/ws/javaee6/webbeans/webbeans-servlet/docs. As with all the Web Beans samples now, you should run with GlassFish V3 - any build after September 2 2009. »
Comments
Comments are listed in date ascending order (oldest first)
|
ArchivesRecent Entries |
|||||
|
|