Surprisingly, under-documented things like this work fine in prettyfaces-3.3.2 (as included by seam-faces-3.1.0.Final), effectively rendering dreadful jsf2 f:metadata tag completely useless (as it, in my humble opinion, should have always been):
This approach would leave, I believe, cleaner action code since it is no longer necessary to declare pageId as well as its getter and setter in managed bean.
Unfortunately, but completely understandably, this will not work if prepareModify() method declares pageId parameter as anything else rather than java.lang.String. I could provide a patch that would do automated conversion from String to standard java types including Integer, Long, BigDecimal, Date, etc.
Just before I start working on that, I would like to confirm no one’s already busy doing that.
very interesting approach. I never thought about doing it this way. Nice catch.
But you are right. The fact that this works only for strings isn’t very userfriendly. But actually I’m a bit surprised that it doesn’t work for other primitive types like int, long, etc. Because this works fine for path parameters directly injected into beans.
However there is currently no more active development done for PrettyFaces 3.x because we are working hard on PrettyFaces 4.0, which will be based on OcpSoft Rewrite and has been rewritten from the scratch. So if you are interested in this feature, you could maybe take a look at Rewrite and test if it works there like expected. And if it does, I see no reason why it should work in PrettyFaces 4.0.
Ah, I see. Ok, I will give Rewrite a try later in the week. Would appreciate it if you could update the documentation as well. We’ve been doing this kind of thing with Seam2 *.page.xml files for quite a while and really missed the feature in Seam3/JSF2. Up until we discovered PrettyFaces, though.