I manged to figure this out.
I changed the following in the web.xml:
<filter-mapping>
<filter-name>Set CORS policy for fonts</filter-name>
<servlet-name>resourceReferenceHandler</servlet-name>
*<url-pattern>/*</url-pattern>*
<url-pattern>*.woff</url-pattern>
<url-pattern>*.eot</url-pattern>
<url-pattern>*.ttf</url-pattern>
<dispatcher>REQUEST</dispatcher>
<dispatcher>FORWARD</dispatcher>
</filter-mapping>
On 3 November 2015 at 16:40, Anton Hughes <ah(a)tradeworks.io> wrote:
Hello
I am looking to use XWiki to manage and provide documentation for my web
based application (built in GWT).
The idea is to use the XWiki rest api that can return clean HTML, for
example
http://platform.xwiki.org/xwiki/bin/view/Features/XWikiRESTfulAPI?xpage=pla…
.
However, to be able to consume this in my gwt application, as I get the
following error:
XMLHttpRequest cannot load
http://localhost:8080/xwiki/bin/view/MyExamplePage?xpage=plain&outputSy…html.
No 'Access-Control-Allow-Origin' header is present on the requested
resource. Origin 'http://localhost:8081' is therefore not allowed access.
How do I add the cors header to the rest response from Xwiki?
Thanks
--
Anton Hughes
--
Anton Hughes