public static void SendToISP(String ISPAdd,String Votes)
{
//send the votes to the next ISP
// Where ISPAdd may be something like this: webaddress
="http://127.0.0.1/examples/servlet/SimpleServlet1"
String webaddress =ISPAdd +"?UserName=xxxxx&Password=****" ;
InputStream is = null;
try
{
is = new URL(webaddress).openStream();
}
catch(Exception e)
{
Aggregator.Sender_Fifo_Queue.add_FifoElement((Object)Votes);
return;
}
BufferedReader br = new BufferedReader(new InputStreamReader(is));
try
{
System.out.println("Web Server returned...");
String nextLine;
nextLine = br.readLine();
while (nextLine != null)
{
System.out.println(nextLine);
nextLine=br.readLine();
}
}
catch(Exception e)
{
System.err.println("Unable to read from InputStream instance");
return;
}
try
{
if (is != null)
is.close();
}
catch(Exception e)
{
System.err.println("Unable to close InputStream instance");
}
}
Ok, I sent to you a method that I'm using, so excuse me if some parts are not usefull
for you, but it's working and it's can solve your problem.
Bye
Antonio Mancuso
___________________________________________________________________________
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff SERVLET-INTEREST".
Archives: http://archives.java.sun.com/archives/servlet-interest.html
Resources: http://java.sun.com/products/servlet/external-resources.html
LISTSERV Help: http://www.lsoft.com/manuals/user/user.html