I have a project on
https://github.com/CarefreeCoding/Gradle-Spring-Hibernate-example
I would like to be able to get visitor's ip address. To do that I need to use HttpServletRequest
as I have found out through searching.
However javax.servlet
library does not seem to be found.
I have tried including 'javax.servlet:servlet-api:2.5'
in my build.gradle script, however that breaks my project as explain in this question.
So the question is. How can I use only libraries from
'org.springframework:spring-core:4.1.2.RELEASE',
'org.springframework:spring-web:4.1.2.RELEASE',
'org.springframework:spring-webmvc:4.1.2.RELEASE',
'org.springframework:spring-orm:4.1.2.RELEASE',
'org.springframework:spring-context:4.1.2.RELEASE',
'org.springframework:spring-tx:4.1.2.RELEASE'
to obtain ip address of the visitor? Or to at least access HttpServletRequest somehow.