gpt4 book ai didi

java - Jersey 可见和 c :import tag lib

转载 作者:行者123 更新时间:2023-11-30 12:00:39 24 4
gpt4 key购买 nike

提供一个资源类,该资源类有一个返回 Viewable 的方法(或者通常是任何 jsp 页面)。有没有办法使用 c:import 或 jsp:include 标签库来包含来自 jaxrs 注释类的 Viewable 响应?例如给定类

@Path("/some/path")
public class SomeJaxrsResource {
@GET
public Viewable get() {
return new Viewable("/the/path/to/the/jsp", this)
}
}

有没有办法在 jsp 中包含它的计算 html一个

<c:import url="/some/path" /> 

或一个

<jsp:include page="/some/path" />

最佳答案

自 Jersey 1.3 起,至少在 URL 受 Jersey 管理时,此功能有效。这在 changelog 中被列为已修复

快速测试显示它也可以在相同的 servlet 上下文中使用外部 URL 和 URLS,但不受 Jersey 的管理。

关于java - Jersey 可见和 c :import tag lib,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/1784301/

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