I am doing Ajax call from cross domain.I would like to allow this call only to the specific domains. What is the best way to get remote origin from HttpServletRequest. Will request.getHeader("Origin")
be available all the time? If remote domain matches I will set
origin = getFromRequest...
if (origin=="example.com"{
response.addHeader("Access-Controll-Allow-Origin",origin);
}