gpt4 book ai didi

java - 如何将输出的文本属性值做成超链接?

转载 作者:太空宇宙 更新时间:2023-11-04 15:26:36 25 4
gpt4 key购买 nike

我应该将书签显示为超链接。所以点击书签将带我到相应的网页。任何人都可以告诉我我应该如何实现我的目标吗?谢谢。

<html>
<f:view>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Insert title here</title>
</head>
<body>
<h:form>
<h1>Welcome to bookmark page</h1>
<h:dataTable value="#{table.bookmark}" var="item" border="1" rows="10">
<f:facet name="header">
<h:outputLabel value="Bookmark table"></h:outputLabel>
</f:facet>
<h:column>
<f:facet name="header">
<h:outputLabel value="Edit"></h:outputLabel>
</f:facet>
<h:selectBooleanCheckbox value="#{item.editBookmark}" onclick="submit">
</h:selectBooleanCheckbox>
</h:column>
<h:column>
<f:facet name="header">
<h:outputLabel value="Sno"></h:outputLabel>
</f:facet>
<h:inputText value="#{item.sno}" rendered="#{item.editBookmark}" size="10">
</h:inputText>
<h:outputText value="#{item.sno}" rendered="#{not item.editBookmark}">
</h:outputText>
</h:column>
<h:column>
<f:facet name="header">
<h:outputLabel value="Bookmarks"></h:outputLabel>
</f:facet>
<h:inputText value="#{item.bookmark}" rendered="#{item.editBookmark}" size="10">
</h:inputText>
<h:outputText value="#{item.bookmark}" rendered="#{not item.editBookmark}">
</h:outputText>
</h:column>
</h:dataTable>
<h:commandButton value="submit">
</h:commandButton>
</h:form>
</body>
</f:view>
</html>

最佳答案

看看 h:outputLink:

<h:outputLink value="#{item.sno}" rendered="#{not item.editBookmark}"><f:verbatim>#{item.sno}</f:verbatim></h:outputLink>

关于java - 如何将输出的文本属性值做成超链接?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/514926/

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