It seems my previous post (the attached file) wasn't very clear!!
Here it is again:

import java.io.*;
import java.util.*;
import javax.jms.*;
import javax.naming.*;
import javax.rmi.*;
import javax.servlet.*;
import javax.servlet.http.*;


public class SampleJmsServlet extends HttpServlet {


    public void doGet(HttpServletRequest request, HttpServletResponse
response)
        throws IOException, ServletException {
        try {



            InitialContext ctx  = new InitialContext();


            QueueConnectionFactory qcf =
(QueueConnectionFactory)ctx.lookup("XAQCF1");
            Queue queue = (Queue) ctx.lookup("sampleQueue");
            QueueConnection qc = qcf.createQueueConnection();
            QueueSession qs = qc.createQueueSession(true,
Session.AUTO_ACKNOWLEDGE);
            QueueSender sender = qs.createSender(queue);
            TextMessage theTextMessage =
                qs.createTextMessage("Test");
            sender.send(theTextMessage);
            qs.close();
            qc.close();

            response.setContentType("text/html");
            PrintWriter out = response.getWriter();
            out.println("<html>");
            out.println("<head>");
            out.println("<title>Sample of Servlet accessing JMS</title>");
            out.println("</head>");
            out.println("<body style=\"background : white; color : black;\">");
            out.println("<h1>Sample of Servlet accessing JMS!!!!!</h1>");
            out.println("<ul>");

        }catch (Exception inException){
            inException.printStackTrace();
        }
    }
   
}

-- 
        Philippe

Philippe Coq  Evidian   Phone: (33) 04 76 29 78 49
Bull S.A  - 1 rue de Provence - 38432 Echirolles Cedex France
Download our EJBServer at http://www.objectweb.org
----
To unsubscribe, send email to [EMAIL PROTECTED] and
include in the body of the message "unsubscribe jonas-users".
For general help, send email to [EMAIL PROTECTED] and
include in the body of the message "help".

Reply via email to