Hi,
I've just added a custom servlet filter (see below) which worked fine.
I've tried to enable the CORS filter provided by Tomcat, but without
success. No idea what's going wrong, but maybe it is related to this
issue:
http://stackoverflow.com/questions/24386712/tomcat-cors-filter
Maybe you can try to debug into this issue a little bit further.
Cheers, Maik
import java.io.IOException;
import javax.servlet.DispatcherType;
import javax.servlet.Filter;
import javax.servlet.FilterChain;
import javax.servlet.FilterConfig;
import javax.servlet.ServletException;
import javax.servlet.ServletRequest;
import javax.servlet.ServletResponse;
import javax.servlet.annotation.WebFilter;
import javax.servlet.http.HttpServletResponse;
@WebFilter(urlPatterns = { "/*" }, dispatcherTypes = { DispatcherType.REQUEST,
DispatcherType.FORWARD, DispatcherType.INCLUDE, DispatcherType.ERROR })
public class SimpleCORSFilter implements Filter {
public void init(FilterConfig config) throws ServletException {
}
public void doFilter(ServletRequest req, ServletResponse res,
FilterChain chain) throws IOException, ServletException {
HttpServletResponse response = (HttpServletResponse) res;
response.setHeader("Access-Control-Allow-Origin", "*");
response.setHeader("Access-Control-Allow-Methods",
"POST, GET, OPTIONS, DELETE");
response.setHeader("Access-Control-Max-Age", "3600");
response.setHeader("Access-Control-Allow-Headers", "x-requested-with");
chain.doFilter(req, res);
}
public void destroy() {
> --
> You received this message because you are subscribed to the Google Groups
> "Jease - The Java CMS with Ease" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to
jease+un...@googlegroups.com.
> For more options, visit
https://groups.google.com/d/optout.