【发布时间】:2014-03-20 15:35:01
【问题描述】:
我的左侧菜单页面 (commonMenu.xhtml) 与 commandButton:
<body>
<h:form>
<ui:composition>
<ul>
<li><a href="/project/pages/foo.xhtml">foo</a> </li>
<li><p:commandButton value="foo"
action="pages/foo" /></li>
<li>Menu 3</li>
</ul>
</ui:composition>
</h:form>
</body>
</html>
目录树如下:
webapp
----->pages
---------->foo.xhtml
---------->templates
---------------->commonMenu.xhtml
问题:
href 工作正常,但是 commandButton 根本不工作。可能是什么原因?
我在action 中尝试了不同的字符串:foo、project/pages/foo、pages/foo 等...
【问题讨论】:
-
我在我的项目上进行了测试,它有效。我不知道你的怎么了。您项目的上下文根是“项目”?加载该页面时是否有错误?
-
查看生成的代码,似乎
<form>没有被渲染,因此UICommand不起作用。 -
@LostHeaven0809 日志中没有错误,我的项目的根是“项目”
标签: jsf navigation commandbutton