Have a look at the various request APIs for servlets (HttpServletRequest and parent).
And so on.
gotta love the newbie questions!!! thx,
There is a key piece to my question that I left out.... is there a way to get the port of the server you are running on in the servlet init method (*before* the first request comes in)?
That's the API I'm looking for and I'm imagining it'd need to be container specific.
AFAIK, no. The servlet has no concept of this since it can serve any request passed on to it from a listener/connector. So you could have a listener on port 8080 passing a request on, as well as a listener on port 80 doing the same. The init is used when the servlet is first created, but once created, it can receive requests from any listener/connector on the server. That's why the information on the URI, etc is contained in the request.
You could specifically provide a value via initparam by I would think this is a bit inflexible. YMMV.