Hi Gato!
First of all, thanks a lot for your answering, I’'m undestanding it better…
To complete my question I wanted to know when an user have/not messages (even inline or offline) I need this feature because as I said, I’'m not working in a chat (on-line im) so I can´t do a “while(true)” loop to wait form messages.
In another hand, I have to wait for a moment to get the messages, laike in the code I show below…
//Creando la conexión al servidor
XMPPConnection conn = new XMPPConnection(server, port);
//Loggando al usuario
try
{
conn.login(jid, pass);
//Create the filter:
PacketFilter filter = new PacketTypeFilter(Message.class);
PacketListener list = new PacketListener(){
public void processPacket(Packet packet){
Message message = (Message)packet;
// I can see the messages in the console, but how I got them to show in ma page?
System.out.println("pepe: " +message.getFrom());
System.out.println(message.getBody());
acumula += " \n";
acumula += " \n";
acumula = message.getFrom() “\n”;
acumula += " \n";
acumula += " \n";
acumula = message.getBody() “\n”;
acumula += " \n";
acumula += " \n";
}};
acumula = “”;
conn.addPacketListener(list, filter);
long cont = 0;
while (cont < 99999999)
{
cont++;
}
acumula += “”;
%>
<%=acumula%>
<%
}catch (XMPPException e)
{
}
%>
I’‘m doing an active-waiting (<- don’‘t know how to say this) to let the XMPPConnection time enough to receive the messages… I know it isn’‘t all right at all, but I don’'t know how to do it. (If I had a method to know that thers no messages, or there are no messages left, I could finish the “building of acumula” in a better way.
Sorry, but I don’'t know where can I find the MessageTes#testOffflineMessages that you mentioned…
THanks again