This week's book giveaway is in the Kotlin forum.
We're giving away four copies of Kotlin in Action and have Dmitry Jemerov & Svetlana Isakova on-line!
See this thread for details.
Win a copy of Kotlin in Action this week in the Kotlin forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

How can we get URL in Spring framework  RSS feed

 
Nagaraju Mulinti
Ranch Hand
Posts: 37
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

I want to know the browser URL and based on the browser URL I need to execute some logic.Is there any way to get URL in Spring framework.

Thanks in advance.
 
Nathan Pruett
Bartender
Posts: 4121
IntelliJ IDE Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I don't know what Controller you're using, but every one has one or more methods that take a HttpServletRequest as a parameter - you can get the URL from the HttpServletRequest method getRequestURL().
 
Nagaraju Mulinti
Ranch Hand
Posts: 37
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Nathan for your info.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!