Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/java/372.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Java 如何将输出文本属性值设置为超链接?_Java_Html_Jsf - Fatal编程技术网

Java 如何将输出文本属性值设置为超链接?

Java 如何将输出文本属性值设置为超链接?,java,html,jsf,Java,Html,Jsf,我应该将书签显示为超链接。因此,单击书签将带我进入相应的网页。有人能告诉我如何实现我的目标吗?谢谢 <html> <f:view> <head> <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"> <title>Insert title here</title> </head>

我应该将书签显示为超链接。因此,单击书签将带我进入相应的网页。有人能告诉我如何实现我的目标吗?谢谢

<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>
{item.sno}

纠正了这个小错误,现在应该可以了
<h:outputLink value="#{item.bookmark}" rendered="#{not item.editBookmark}" <h:outputText value = "#{item.bookmark}" ></h:outputText> </h:outputLink>