Link to home
Start Free TrialLog in
Avatar of rajneetbhatia
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
ASKER CERTIFIED SOLUTION
Avatar of girionis
girionis
Flag of Greece image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of rajneetbhatia
rajneetbhatia

ASKER

Actually i want to get the complete path.
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.
> Actually i want to get the complete path

you can use:

String uri = request.getRequestURI();
I don't want to use request here.. I want an alternative to this.
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial