Smack and J2EE

I have written Java XMPP applications using Smack. I have written websites using jquery, strophe, BOSH, and xmpp.

What I am trying to understand now is how to use Smack in a J2EE application. Specifically I will be accessing the pubsub portion of XMPP. My weak spot is my knowledge of J2EE as I am new to developing J2EE applications.

Can I have long-lived Smack connection on a Servlet (or Portlet) that forwards info in RequestResponse when a message/notification is received from the XMPP server. Does anyone have a small example of this, or can perhaps point me toward a helpful link/etc.

Thank you for your time.

Hi

you can check out the framework that I’m developing. It has both client and server portion. In the server portion, you write message handler, packaged as a WAR file and deploy to glassfish.

The following blog introduces the server component (acutally its an external component)

http://oneminutedistraction.wordpress.com/2011/08/07/integrating-cdi-with-vorpal -and-the-cuckoo-bird-effect/