How to get servername
843835Aug 27 2002 — edited Sep 16 2005hi, everyone
I want to get servername from a servlet.
I know that I can get it from the parameter request by calling the method "request.getServerName()". But now I have to get the servername from method "init()" of HttpServlet. The code is as :
public class MyServlet extends HttpServlet {
public void init(){
String servername = xxx.getServername();
......
}
}
But I don't know how to do, and I don't know if it is possible. help me please.
Thanks .