-
1. Re: Access Seam Component from Servlet
quilleashm Mar 27, 2007 11:22 AM (in response to bengao)@In can only be used inside declared seam components (ones with @Name or explicit name in components.xml). You can't inject seam components into any object, only other seam components.
-
2. Re: Access Seam Component from Servlet
fernando_jmt Mar 27, 2007 11:48 AM (in response to bengao)You can use Components.getInstance("SeamComponentName");
-
3. Re: Access Seam Component from Servlet
gavin.king Mar 27, 2007 12:43 PM (in response to bengao)No, it is not a Seam component. You need to:
(1) wrap the context filter around the servlet
(2) use Component.getInstance() -
4. Re: Access Seam Component
pdhaigh May 10, 2007 2:11 PM (in response to bengao)(1) wrap the context filter around the servlet
Is it possible to access seam components without an HTTP request?
e.g. in a background maintenance thread? (perhaps started with a servlet init-on-startup) -
5. Re: Access Seam Component from Servlet
christian.bauer May 10, 2007 2:23 PM (in response to bengao)I don't think that is currently possibly. Although that is the same problem we have with webservice calls, and Shane has implemented something in CVS already for this. I didn't look at it so I'm clueless but you might want to check the examples Shane has been working on.
-
6. Re: Access Seam Component from Servlet
pmuir May 10, 2007 4:15 PM (in response to bengao)Yes it is possible, it just depends on where the request originates. We currently have:
* JBPM
* EJB MDB (JMS works on 4.0.5, other JCA doesn't)
* EJB timers
* WS (in CVS)
* JSF (for completeness)
Otherwise, you *should* be able to apply the principle to another request - you just have to set up and clean up the Seam contexts yourself - this is obviously harder for stateful than stateless requests (you just have EVENT and APPLICATION scope for free, no session).
HTH