Win a copy of Learn Spring Security (video course) this week in the Spring forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

get domain url

 
Joseph Sweet
Ranch Hand
Posts: 327
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Does anyone know how I can get the domain url by somthing like the ServletContext.

Somthing like http://www.mydomain.com

Thanks.
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64613
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Did you check the API for HttpServletRequest?
 
Joseph Sweet
Ranch Hand
Posts: 327
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Are there any methods to get only the protocol + domain part from the string returned by HttpServletRequest.getRequestURL()

?
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic