My current environment is JRE 1.7, JSF 2.2, Eclipse Luna. In a certain page (entity_index.xhtml
) of my application I have the following (PrimeFaces) button:
p:commandButton
performs a POST request. You want simply to GET a view with your entity detail, not to POST the server, so you need a h:link
:
Then, the f:viewParam
in the destination page will be able to process the url parameter:
Use a f:viewAction
to initialize your entity instead of doing it in a getter, which is discouraged:
public void init(){
entity = entityById(id);
}
See also: