Win a copy of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) this week in the OCAJP forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

How can we get URL in Spring framework

 
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