“This link is deactivated, because it is not embedded in a JSF form.”

≡放荡痞女 提交于 2019-12-01 16:19:35
BalusC

The <h:commandLink> fires a POST request. You need to embed it in a <h:form>.

<h:form>
    <h:commandLink action="student" value="students" />
</h:form>

Since you're already on JSF 2.0, you can also just use <h:link> instead which fires a GET request which doesn't require a form and is thus way much better for bookmarkability and SEO. Also you can get rid of the whole <navigation-rule> since JSF 2.0 utilizes implicit navigation.

<h:link value="students" outcome="student" />

It will implicitly go to student.xhtml.

Ensure that you're reading JSF 2.0 tutorials, not the ones targeted on JSF 1.x. In JSF 2.0 a lot of new tags and features have been added.

See also:

You need to have <h:form> wrapping the link.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!