You have to defer the binding of the parameter to get it to work correctly. That’s because by default Rewrite processes bindings very early during request processing, even before the JSF lifecycle starts. But if you defer the binding, it will be submitted after the JSF lifecycle started. Just add the @Deferred annotation to your parameter like this:
private Long id;
I’m currently thinking about adding some kind of auto detection mechanism that automatically adds the deferral if the injection happens on a JSF bean (or a CDI bean with a JSF view scope) But that is still WIP. So for now you have to add the annotation manually.
BTW: You have to add rewrite-integration-faces for this to work correctly.
Do you play Magic?
Get TopDecked MTG, the #1 Magic App, built by players, for players. Free to use, forever.