Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

how to get first part of URL ?

 
Nakata kokuyo
Ranch Hand
Posts: 472
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Pie
Posts: 65223
95
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Have you explored the methods on HttpServletRequest?
 
Nakata kokuyo
Ranch Hand
Posts: 472
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
thanks, bear , i have try on getContextpath and getPathInfo() ....now only realize is actually request.getLocalName(); ...
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic