This week's book giveaway is in the Jython/Python forum.
We're giving away four copies of Murach's Python Programming and have Michael Urban and Joel Murach on-line!
See this thread for details.
Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

server down/up???  RSS feed

sakthivel shan
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Dear All,
I am trying to get authentication from my server, by using the below function...Here is a doubt...Once if my server is in "DOWN" state, i am getting the errors fired in my command can i avoid this???.....i mean, i want to avoid the process of authentication, if the server is "DOWN" to find out whether a server is running in that url or not???

public String authenticateMe(String username, String password)
String setcookie="";
String cookie="";
URL theurl = new URL("" + username + "&password=" + password);
HttpURLConnection hurl = (HttpURLConnection)theurl.openConnection();
setcookie = hurl.getHeaderField ("set-cookie");
int index=setcookie.indexOf(";");
catch(Exception exp)
return cookie;

Sakthivel S.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!