Hey all,
I'm trying to retrieve a URL from my servlet using the URL class
and then making a inputreader from the URL.openstream, etc.
The problem I have is how to do this through the firewall and the proxy for
that.
I've got no idea so, please, any help is appreciated.
Even though I 'open' my account with the firewall so that it doesn't ask me
the user name and passwd (like within a browser) I still get an IOException
using the following code:
-----------------
try
{
search_url = new URL(Query);
File outFile = new File(fileName);
PrintWriter outStream = new PrintWriter(new FileWriter(outFile));
BufferedReader inStream = new BufferedReader(new
InputStreamReader(search_url.openStream()));
String line;
while ((line = inStream.readLine())!= null)
{
outStream.println(line);
}
inStream.close();
outStream.close();
} catch (MalformedURLException ex)
{
dbWin.println(col,"Error in doSearch: MalformedURLException occured.");
} catch (NoRouteToHostException ex)
{
dbWin.println(col,"Error in doSearch: NoRouteToHostException occurred.");
} catch (IOException ex)
{
dbWin.println(col,"Error in doSearch: IOException occurred.");
}
------------
Sorry for the long code excerpt.
Thanx,
Sean.
___________________________________________________________________________
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