Inherit/Share query-params

Splash Forums PrettyFaces Users Inherit/Share query-params

This topic contains 15 replies, has 4 voices, and was last updated by  Lincoln Baxter III 10 years, 6 months ago.

Viewing 15 posts - 1 through 15 (of 16 total)
  • Author
  • #17983


    I have several pages all next to each other in a folder that all share a common set of query parameters that I map back to the same bean.

    Is there a way to share or inherit these parameters? There are about 20 of them and I don’t want to have to repeat that list of 20 query parameters over and over for each page.



    For now I would suggest creating a ConfigurationPostProcessor that can do the appropriate setup for you.

    I know it’s a bit of a long way around, but it’s the best way to do this right now.

    PrettyFaces 4 should address this issue in a nicer way, but that’s a way out yet.




    Actually I just used a ConfigurationPostProcessor to implement URLQueryParameter inheritance a couple of days ago. It was very easy using a recursive method + a set of mapping ids already processed.

    While we’re on the subject, however, the inheritance hierarchy didn’t support equals() all the way down (as I recall, one of the components of RequestParameter relied on Object.equals() ), such that I had to implement the check for equality among URLQueryParameters myself. I would request this situation be improved for the future.



    Actually something like this should be possible with mapping inheritance. But unfortunately inheritance of query parameters in not yet implemented in PrettyFaces. See:

    This issue request is tracked here:

    I hope we will be able to implement this for the next version.


    Thanks for this feedback! Could you perhaps open a ticket for this? So we can fix this in the next release? Thanks!


    @mbenson if you feel so inclined, would you like to share your solution?




    I would think it possible to implement equals/hashCode on LazyExpression using the beanClass + component. It would be up to you guys whether it is also necessary to test the equality of the embedded LazyBeanNameFinder.

    @lincoln: I don’t really want to C&P code I wrote on my employer’s dime; however, briefly:

    void process(PrettyConfig config) {
    HashSet<String> processed = new HashSet<String>();
    for (UrlMapping mapping : config.getMappings()) {
    process(config, processed);

    void process(UrlMapping mapping, PrettyConfig config, Set<String> processed) {
    if (processed.contains(mapping)) {
    UrlMapping parent = config.getMappingById(mapping.getParentId());
    if (parent != null) {
    process(parent, config, processed);
    for (QueryParameter parentParam : parent.getQueryParams()) {
    //exercise for the reader, comparing name/expression string
    if (!containsSimilar(mapping.getQueryParams(), parentParam)) {


    Hey all,

    I just implemented inheritance for query parameters and URL actions. In my tests it seems to work very fine. The current snapshots of 3.3.1 already contain my changes. Perhaps someone would like to take the new version for a test drive? You will find all the required details for how to use the snapshots in your project here:





    So you decided inheritance of these items was a sensible default? Not questioning the decision, but making conversation and seeking understanding ;) . I’ll give the snapshots a try this coming week.


    P.S. (off-topic) how the hell do I change my avatar to something cool?


    Hey Matt,

    yes, I think query parameters should definitively be inherited per default. I think that users expect this to happen if they use the parentId feature. We are currently discussing how to handle the inheritance of URL actions. In the current snapshots a child mapping will simply inherit all actions from the parents. But this may not be desired in all cases. See my post here for details.

    I hope the new inheritance code will work for you. I think you will be able to drop your custom ConfigurationPostProcessor in the future as PrettyFaces will do everything for you.

    Regarding the avatar: The forum is using for the avatars. Just sign up there with the email address you used for your forum registration and it should work out of the box! :)

    Have a nice weekend. :)




    I think that the inheritance feature was probably over-thought when I first created it. Simply inheriting everything is definitely a more logical approach.

    I’m looking forward to trying this out myself :)


    @lincoln: So you think we won’t need a inheritable flag for URL actions like I proposed? I would be OK with that! :)

    @mbenson: Much better avatar! :)



    chkal: thanks! ;)



    Hi guys,

    Trying to give the snapshot a spin; wanted to simply add as a proxy snapshot repo in my Nexus install, then add it to my snapshots group. However the artifact names at don’t look like what I’m accustomed to seeing. Is there anything you guys are aware of in that regard of which *I* should also be aware?




    Not that I know of. We use the mvn:deploy plugin and the wagon FTP carrier.



    not sure what the deal was; snapshot is coming through for me now. Sorry for the noise. Just tested this out and working as advertised. Thanks!

Viewing 15 posts - 1 through 15 (of 16 total)

The forum ‘PrettyFaces Users’ is closed to new topics and replies.

Comments are closed.