【问题标题】:Allow CORS in wicket 6.20在 wicket 6.20 中允许 CORS
【发布时间】:2018-05-05 18:50:40
【问题描述】:

我在 wicket Web 应用程序中遇到了 CORS(跨源资源共享)问题。 在本地网络中一切正常。在线部署我的网络应用程序后,我在浏览器控制台中收到以下错误。

No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'http://localhost' is therefore not allowed access. If an opaque response serves your needs, set the request's mode to 'no-cors' to fetch the resource with CORS disabled.

如何在我的服务上允许跨源? 我正在使用检票口 6.20。

【问题讨论】:

    标签: java cors wicket


    【解决方案1】:

    你可以按照here的建议这样做:

    getCurrentWebResponse().addHeader("Access-Control-Allow-Origin", "http://localhost:8080");
    

    希望这有助于解决您的问题!

    【讨论】:

    • 没有帮助。我不得不使用过滤器在野蝇级别允许它。谢谢
    • 您可以考虑添加自己的答案来解决指出的问题,它可能会帮助有需要的人!
    • @Salearnah 你能发布你为 WildFly 所做的事情吗?这是我目前正在尝试解决的问题
    猜你喜欢
    • 2017-07-28
    • 1970-01-01
    • 2021-12-31
    • 2015-06-02
    • 2014-11-09
    • 2018-03-02
    • 2019-12-30
    • 1970-01-01
    • 2021-01-09
    相关资源
    最近更新 更多