PHPz2017-04-18 09:19:21
You don’t need to raise your hand to ask these questions...
http://www.open-open.com/lib/view/open1463878352785.html
天蓬老师2017-04-18 09:19:21
If it is servlet
的话,那简简单单一个filter
, it can be done, and someone has already done it, just use it: cors-filter.
If your problem is that you don’t understand cross-domain, then you have to read: Building public APIs and CORS
天蓬老师2017-04-18 09:19:21
public class CorsConfigurerAdapter extends WebMvcConfigurerAdapter{
@Override
public void addCorsMappings(CorsRegistry registry) {
registry.addMapping("/api/*").allowedOrigins("*");
}
}