Spring AOP日志实现(二)--获取访问者IP及访问路径

获取类及方法上的@RequestMapping注解:

获取访问者的ip地址,首先配置一个监听器:

配置完监听器后,就可以在类中注入一个HttpServletRequest:

获取ip:

猜你喜欢

转载自www.cnblogs.com/niwotaxuexiba/p/10848409.html