[JBoss Seam] - Re: Injection and remoting
by sbryzak2
"gllambi" wrote :
| I'm new to Remoting and Ajax, can you give me a good example when to use it?
|
It's hard to give a definitive answer, because I'm sure there's some usage scenarios that I haven't even thought of yet. In general, you should use it when your page can benefit from making a fine-grained API call against a Seam component, without needing to refresh your entire page.
anonymous wrote :
| So it's not posible to inject it with the @In annotation?
|
Not right now, however one of the things in my todo list (there's a feature request in JIRA for it) is to integrate the page context with remoting. Once this is done, you will be able to inject values from the page context into your component.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3985982#3985982
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3985982
19Â years, 8Â months
[JBoss Seam] - @Service MBEan as Seam component
by arondaniel
Hello,
Sorry for the newB-nature of this question, but I did do a fair amount of google/forum searching before posting.
What I'm wondering is if it is possible to use a @Service annotated JBoss MBean also as a @Name annotated seam component (with APPLICATION scope I guess) -- such that Seam makes calls on the singleton instance.
I tried something like this:
| @Service(objectName = "someapp:service=theManager")
| @Management(TheManager.class)
| @Name("theManager")
| @Scope(APPLICATION)
| @Interceptors(SeamInterceptor.class)
| public class TheManagerMBean implements TheManager {
| @PersistenceContext
| private EntityManager m_em;
| public Something getSomething() {
| return m_em.find(Something.class,"Something");
| }
|
Then in a jsp I try to call "#{theManager.something.foo}".
So what happens is it goes into getSomething just fine, but apparently Seam has created a new THeManagerMBEan instance for me, instead of using the MBEan singleton, because m_em is null.
Is this something that is just not supported? Can a MBean be accessed directly using seam? Do all Seam components have to be Entity/Stateful/Stateless/some other POJO?
Sorry if my question is facile, I'm new to all this JSP/JSF/Seam stuff.
-Aron
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3985980#3985980
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3985980
19Â years, 8Â months