rajneetbhatia
asked on
Alternative to getServerName() through Servlets
Hi,
I am using request.getServerName(), to get the server name through servlets. (where request is the request object). Please let me know how can I get the servername instead of using this request object.
Waiting for reply.
Regards,
R S
I am using request.getServerName(), to get the server name through servlets. (where request is the request object). Please let me know how can I get the servername instead of using this request object.
Waiting for reply.
Regards,
R S
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
> Actually i want to get the complete path
you can use:
String uri = request.getRequestURI();
you can use:
String uri = request.getRequestURI();
ASKER
I don't want to use request here.. I want an alternative to this.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Say I am calling my page as :
http://server1111:8080/ABC/index.html
Presently I am using getServerName method of request object to get
server name as "server".
port as "8080"
Path as "ABC"
Now instead of using this request object I want to get the servername using some other way, how can I do that.
Waiting for reply.