The Authenticator class (I assume you are using the one from OReilly) encodes the Authentication information in the http request header. The Server or Servlet has to be configured to accept the authentication in this manner. If when you connect using a browser, a popup window is displayed for username and password, you can be fairly sure it's configured that way. If you want information on writing a servlet that reads the Basic Authentication from a http request header, I recommend you post the question in Serlvet forum.
------------------
I Hope This Helps
Carl Trusiak, SCJP2, SCWCD