I have a Spring-MVC webapp (3.0.5-RELEASE) that needs to access JSON web services from another webapp in another subdomain (from client / browser via AJAX).
I solved this in the past:
writing a simple controller that proxies requests using Apache Commons HttpClient to handle requests. Thus, overcoming the security restrictions of cross-site / cross-source requests for most browsers
server-side JSONP implementation (when invoking our own JSON services) - not always possible
In the case where JSONP is not possible, is there a better way to do (1.)?
and / or
Is there a library that will handle this for me? So I don’t need to write all the HttpClient code myself - there isn’t much code for it, but I wonder if I (badly) reinvent the wheel.
java spring ajax spring-mvc proxy
nickdos
source share