如何在Websphere Application Server Liberty Profile V8.5中定义CORS [英] How to define CORS in Websphere Application Server Liberty Profile V8.5
问题描述
是否可以在Websphere应用服务器Liberty Profile V8.5中应用跨源资源共享(CORS)?
我搜索了红皮书,找到IBM提到的任何事情。
( http://www.redbooks.ibm.com/abstracts/sg248076.html?打开)
这是不是我可以像这样以编程方式设置标题:
Access-Control-Allow-Origin:*
( http://enable-cors.org/server.html )
<您必须在
WEB-INF / lib
文件夹中添加以下jar: 在 web.xml
中,您必须添加以下规则:
< filter>
< filter-name> CORS< / filter-name>
< filter-class> com.thetransactioncompany.cors.CORSFilter< / filter-class>
< / filter>
< filter-mapping>
< filter-name> CORS< / filter-name>
< url-pattern> / *< / url-pattern>
< / filter-mapping>
Is it possible to apply cross-origin resource sharing (CORS) in a Websphere Application Server Liberty Profile V8.5 ?
I searched the redbook but couldn't find IBM mention anything about it. (http://www.redbooks.ibm.com/abstracts/sg248076.html?Open)
It's not possibility for me to set the headers programmatically like this:
Access-Control-Allow-Origin: *
(http://enable-cors.org/server.html)
You have to add following jars to your WEB-INF/lib
folder:
In your web.xml
you have to add following rules:
<filter>
<filter-name>CORS</filter-name>
<filter-class>com.thetransactioncompany.cors.CORSFilter</filter-class>
</filter>
<filter-mapping>
<filter-name>CORS</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping>
这篇关于如何在Websphere Application Server Liberty Profile V8.5中定义CORS的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!