gpt4 book ai didi

java - 外部 Vaadin 请求在哪里处理?

转载 作者:行者123 更新时间:2023-12-02 04:33:30 28 4
gpt4 key购买 nike

外部 Vaadin 请求在哪里处理以及如何更改其行为?

例如:

String url = "http://anyhost.com/image.jpg";
Image i = new Image();
i.setSource(new ExternalResource(url));

是否有某种用于外部资源的 RequestHandler?

提前致谢

最佳答案

在这种情况下,URL 只是被传递给 ExternalResource客户端,即浏览器。如果您尝试上面的代码,您会看到一个错误,即图像无法加载到您的开发工具中。生成的 HTML 代码(例如 Inspect Element)只是 <img src="http://anyhost.com/image.jpg" .../> 。服务器部分不会获取该资源并为客户端“托管”它。

或者作为 docs状态:

ExternalResource implements source for resources fetched from location specified by URL:s. The resources are fetched directly by the client terminal and are not fetched trough the terminal adapter.

关于java - 外部 Vaadin 请求在哪里处理?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/31137266/

28 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com