aspose file tools*
The moose likes JSP and the fly likes how to get first part of URL ? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » JSP
Bookmark "how to get first part of URL ?" Watch "how to get first part of URL ?" New topic
Author

how to get first part of URL ?

Nakata kokuyo
Ranch Hand

Joined: Apr 13, 2005
Posts: 442
hi, good day, if i would like to get the first part(don't know what it call) of URL http://myservername/app/index.jsp in jsp page

is there any method we can use ?

meaning i need to get the result with "myservername" , not other part ..any idea ? thank you for guidance
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61606
    
  67

Have you explored the methods on HttpServletRequest?


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
Nakata kokuyo
Ranch Hand

Joined: Apr 13, 2005
Posts: 442
thanks, bear , i have try on getContextpath and getPathInfo() ....now only realize is actually request.getLocalName(); ...
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: how to get first part of URL ?