powered by Jive Software

Web based client

I’‘m developing a web based client using Smack library, but I’'ve had a problem with the XMMPConnection …

Does anyone knows how can I keep a XMMPConnection through a JSP/servlet session or when the page is refreshed ? … I mean … open a XMMPConnection from a page, and after that, put it in a session for later close it from another page …

… no one knows ?? …

Sorry, never done any JSP myself. It doesn’‘t seem possible that way… you’'d have to have some sort of persistent object.

I think it is not possible. As soon as you put the object into the session and your request on the server has ended, the object is serialized and stored. As the XMMPConnection is statefull and has an open socket to the server this will not work. Even if you can manage to store it into the session(without smack terminating the socket), the jive server will for sure terminate the connection and therefore logoff if he can’'t send packets to your XMMPConnection (which is serialized in the session and has no chance to accept these).

Somewhere in the forums is a JCA resource adapter mentioned which is programmed currently. Maybe you’'ll try to use this one.

I was thinking to do the same thing too, but I will not use the approach like yours … as I know there will be plenty of thing to take care of. So I’'m using an Applet approach!

Anyway, by refering to your case, you can use a JavaBean to store the connection instance … and since the bean is session-based, this make the keeping track of user possible! Remember to close the connection during the bean removal phrase!

If I were to use your approach, I will use a JSF architecture (seriously consider that). Interesting idea thought … I’'ll try to do some disccussion in my blog (http://avatar21.superihost.com) regarding this!

Just curious, are you creating your own XMPP server or using the public like Google Talk server? Because I was thinking to make my own XMPP server!

Regards,

Avatar Ng

Message was edited by:

avatar21