[JBoss Seam] - Can't remote to session bean instance in server initiated co
by JohnEChesher
I have a stateful session bean in conversation scope and reach a page that is within that conversation/scope. from that page, I make a remote call to the bean, but it is getting a new instance of the bean. Before the remote call, if I make a remote call to get the conversation ID, it is null. After the remote call (I unclick the checkbox below to execute the remote call a 2nd time) if I make a remote call to get the conversation ID, it is one more than the long running conversation ID that is still active on the server. Is there no way to "join/utilize" the existing conversation using Seam remoting? The ref doc discusses conversations and remoting and I've seen posts regarding it, but the posts involve starting, using and ending the conversation all through remote access, not accessing a bean in a conversation that already exists...
Thanks!
Here are my code snippets:
...
| @Stateful
| @Name("maintainUsers")
| @Restrict("#{identity.loggedIn and s:hasPermission('userAndInstitution','create', null)}")
| public class MaintainUsersAction implements MaintainUsers {
| ...
| public void addOneFamilyInst(Long id, boolean checked){
| if (checked) {
| System.out.println("Checked Inst");
| }
| else {
| System.out.println("Unchecked Inst");
| }
| return;
| }
| ...
<input type="checkbox" onclick="addFamily(#{i.id}, this.checked);"/>
| ...
| <script type="text/javascript">
| function addFamily(instId, checked)
| {
| cid = Seam.Remoting.getContext().getConversationId();
| alert('Conversation id: ' + cid);
| Seam.Remoting.getContext().setConversationId(cid);
|
| var remoteManager = Seam.Component.getInstance('maintainUsers');
| Seam.Remoting.startBatch();
| remoteManager.addOneFamilyInst(instId, checked);
| Seam.Remoting.executeBatch();
|
| }
| </script>
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4037080#4037080
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4037080
19 years
[JBoss Portal] - ActionRequest setAttribute
by engela
According to the JSR 168 Spec PLT 11.1 PortletRquest Interface, Section PLT 11.1.13 anonymous wrote : Request attributes are objects associated with a portlet during a single portlet request. Request attributes may be set by the portlet or the portlet container to express information that otherwise could not be expressed via the API. Request attributes can be used to share information with a servlet or JSP being included via the PortletRequestDispatcher.
This suggests that an attribute set in the ActionRequest should be propagated to a JSP. But if I set an attribute in processAction:
public void processAction(ActionRequest request, ActionResponse response) throws PortletException
| {
| // some processing done here ....
| request.setAttribute("myattribute", "some object");
| }
then it does not get propagated to my JSP and the result of
<% MyObject oby = (MyObject)renderRequest.getAttriubte("myattribute"); %>
is null. Is this a bug or do I misinterpret the JSR 168 Spec?
Either way it's a shame as this means I have to stick all information to the PortletSession even if it's related to a specific request. From Servlets I am used to sticking objects created while handling a request into a request attribute rather then a session attribute (unless it's information which I will need for future requests like user information).
Best Regards,
Anette
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4037074#4037074
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4037074
19 years