GWT + Seam, cannot fetch scoped beans from gwt servlet in seam resource servlet.
- by David Göransson
Hello all
I am trying to get session and conversation scoped beans to a gwt servlet in the seam resource servlet. I have a conversation scoped bean:
@Name ("viewFormCopyAction")
@Scope (ScopeType.CONVERSATION)
public class ViewFormCopyAction
{}
and a session scoped bean:
@Name ("authenticator")
@Scope (ScopeType.SESSION)
public class AuthenticatorAction
{}
There is a RemoteService interface:
@RemoteServiceRelativePath ("strokesService")
public interface StrokesService
extends RemoteService
{
public Position getPosition (int conversationId);
}
with corresponding async interface:
public interface StrokesServiceAsync
extends RemoteService
{
public void getPosition (int conversationId, AsyncCallback callback);
}
and implementation:
@Name ("com.web.actions.forms.gwt.client.StrokesService")
@Scope (ScopeType.EVENT)
public class StrokesServiceImpl
implements StrokesService
{
@In
Manager manager;
@Override
@WebRemote
public Position getPosition (int conversationId)
{
manager.switchConversation( "" + conversationId );
ViewFormCopyAction vfca = (ViewFormCopyAction) Component.getInstance( "viewFormCopyAction" );
AuthenticatorAction aa = (AuthenticatorAction) Component.getInstance( "authenticator" );
return null;
}
}
The gwt page is within an IFrame in a regular seam page and the conversationId is propagted with the src attribute of the IFrame.
Both bean objects end up with only null values. Can anyone see anything wrong with the code? I know that I could use strings instead of the int, but never mind that at this point.