• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Applet to Servlet

 
aitex abex
Greenhorn
Posts: 20
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
try{
String myServletUrl = getCodeBase()+ "mystatusservlet.jsp";
java.net.URL url = new java.net.URL(myServletUrl);
java.net.URLConnection urlConn = url.openConnection();
---------
------
----
}catch(Exception e){
e.printStackTrace();
}

I am doing connection to servlet through Applet in my code..
When my Application server is down then my Applet waiting & only waiting for connection long time, My problem is that in this case i have to provide some message to client like "App is down try after some time" .

Applet even not throw any exception in this case.
How can i handle this type of problem???
 
Ernest Friedman-Hill
author and iconoclast
Marshal
Pie
Posts: 24212
35
Chrome Eclipse IDE Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Please don't post the same question to more than one forum. See here for an explanation of why I just deleted the other copy of this thread.

As for an answer to your questions: please have a look at the Javadoc for HttpURLConnection in Java 5. There are several methods that would solve your problems perfectly. The Javadoc for the classes you're using should always be the first place you go for help.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic