0
@RequestMapping("/test")
public String test() {
    return "test";
}

I wrote an interface I want to get the URI of the interface to do different authentication according to the uri. But I visit localhost / test / can also be routed to / test How do i set What I get using getServletPath () method is also with / enter image description here

1 Answers1

0

you can get using below:

@RequestMapping(value ="/test")
public String test(HttpServletRequest request){
String test = request.getRequestURI();
return test;
}
Sushil Mittal
  • 494
  • 4
  • 10