• Post Reply Bookmark Topic Watch Topic
  • New Topic

getProtocol() problem  RSS feed

 
Mike London
Ranch Hand
Posts: 1495
11
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Sometimes in an applet, the code that reads the current protocol returns "file", which causes the servlet connection to fail.
The suspect code is:
URL currentPage = getCodeBase(); // get base URL of the applet
String protocol = currentPage.getProtocol();
String host = currentPage.getHost();
int port = currentPage.getPort();
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!