English 中文(简体)
JSF f:参数 - 参数无法访问
原标题:JSF f:param - parameter not accessible

我通过了一个参数"父母" 如下。

<h:commandLink rendered="some contidion" >
    <td>
        <a href="home.xhtml">
                <img  src="icon.png" width="140" height="140" alt="alternate" />
        </a>
    </td>                       
    <f:param name="parent" value="ABC" />
</h:commandLink>

但是在home.xhtml上,我不能读成:

#{param.parent}

我犯了什么错?

问题回答

您正在错误地使用 h: commandLink 。 您不需要嵌入 a: href 。 使用 < code > action 属性 。

如果您不想调用一个动作方法使用 h:link : ,则更好:

<h:link outcome="home" >
   <img ...>
   <f:param name="parent" value="ABC" />
</h:link>

您可以访问您的家。 xhtml 喜欢这里 。

   <h:outputText value="Value, {0}">
        <f:param value="#{yourBean.name}"/>
   </h:outputText>

您可以将 h:outputText 替换为 h:outputFormat 或类似的东西 。





相关问题
JSF a4j:support with h:selectManyCheckbox

I m having trouble with a JSF selectManyCheckbox and A4J support. The purpose is to run some action when a checkbox is selected. This works perfectly in Firefox. Yet, when testing in any IE (ie6 / ie7 ...

Mojarra for JSF Encoding

Can anyone teach me how to use mojarra to encode my JSF files. I downloaded mojarra and expected some kind of jar but what i had downloaded was a folder of files i don t know what to do with

如何拦截要求终止?

在共同基金中,如果用户要求终止,就需要采取一些行动。 我需要某种拦截器,但我不知道如何这样做。 我需要帮助。 增 编

ICEFaces inputFile getting the file content without upload

Is there any way of just getting the content of the browsed file without any upload/file transfer operations? I currently use ICEFaces inputFile component but I do not need the default uploading ...

Weird behaviour of h:commandLink action (MethodExpression)

I have two JSPs where I am displaying some info from database in a h:dataTable. One of them is showing all the info, and one of them user specifically. I have showXML.jsp that shows the "XML" column ...

How to correctly use ResultSet with h:dataTable

The problem is, that after displaying the ResultSet with <h:dataTable>, the connection is left open. If I close it, it closes the ResultSet too. I m thinking about copying the ResultSet data ...

热门标签