Jsf 使用a4j:commandLink和属性actionListener时不调用bean
您好,我想在Jsf 使用a4j:commandLink和属性actionListener时不调用bean,jsf,ajax4jsf,Jsf,Ajax4jsf,您好,我想在commandLink中使用actionListner <ui:define name="content"> <a4j:log/> <a4j:form id="home"> <h:commandLink value="bla" actionListener="#{SearchBean.search }"> <f:param name="keyWord" value="hello">
commandLink
中使用actionListner
<ui:define name="content">
<a4j:log/>
<a4j:form id="home">
<h:commandLink value="bla" actionListener="#{SearchBean.search }">
<f:param name="keyWord" value="hello"></f:param>
</h:commandLink>
//some more JSF
</a4j:form>
</ui:define>
但是没有对bean的调用。
我试着用
f:attribute
和h:commandLink
代替a4j,但效果不太好。你在哪里声明了你的bean?如果你没有为它选择一个特定的名称,jsf会在上下文中将它命名为降低第一个字符#{ SkcBeab}尝试删除ActuistListor函数名
结尾处的空白。奇怪的是,如果我从A4J中删除命令链接并将其放入H:表单中,就会调用搜索方法…public class SearchBean {
public void search(ActionEvent e)
{
String myAttribute = FacesContext.getCurrentInstance().getExternalContext().getRequestParameterMap().get("keyWord").toString();
System.out.println(myAttribute);
}
}