*
The moose likes JSP and the fly likes hot to get the server name using jsp Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


JavaRanch » Java Forums » Java » JSP
Bookmark "hot to get the server name using jsp" Watch "hot to get the server name using jsp" New topic
Author

hot to get the server name using jsp

Santosh Kumar
Ranch Hand

Joined: May 25, 2005
Posts: 30
hi

i wanted to get the file path along with the server name using jsp
can i get he server name using jsp
how can this be done

waiting for your reply



regards
santosh
Sravan Kumar
Ranch Hand

Joined: Sep 11, 2005
Posts: 121
I am not sure if you really need the server name but this is the way you get it. Use request.getServerName().

If you need the context path to be appended to your file, then usen request.getContextPath()


keep smilin :: sravan<br /><a href="http://sravanpens.blogspot.com" target="_blank" rel="nofollow">I scribble here</a>
 
GeeCON Prague 2014
 
subject: hot to get the server name using jsp