Url encoding (again) and /#{some}strage#{links}

Splash Forums PrettyFaces Users Url encoding (again) and /#{some}strage#{links}

Tagged: ,

This topic contains 7 replies, has 3 voices, and was last updated by  Christian Kaltepoth 10 years, 10 months ago.

Viewing 8 posts - 1 through 8 (of 8 total)
  • Author
  • #17900



    I have some legacy links structure that I need to follow:


    Where ‘x’ is a name and it is not revelant, ‘,Y,’ is a enumeration that defines the link type and 123 is an id.

    So I would like to have a pattern:


    but such pattern does not work in PrettyFaces (does it?)

    So I try to use a pattern like (I use annotations):

    /#{ /.*,Y,\\d+/ full}

    And it works, well… almost. When I hit an address like /x,Y,123 and then do something (so outbound rewrite is used) I am redirected to url: /x%2CY%2C123

    Nevertheless this url still matches the pattern :)


    1) Is it possible to use slashless patterns like /#{one}two#{three}

    2) Can I plug into outbound link generation? Preferably in a way that does not involve AspectJ :)

    There are some characters that can, but does not have to be encoded like ‘,’ ‘(‘ ‘)’. Or ‘+’, but this one have been already mentioned in other thread. Not sure is there more of them.


    Krzysztof Kowalczyk


    Hey Krzysztof,

    thanks for bringing this up! I think I know what is going wrong here. I think there is one place left in our code where we are still using URLEncoder which is not correct. URLEncoder encodes some characters not correctly for URLs. Especially the space character and maybe also the comma character.

    I’ll have a look at this and come back to you soon.


    PS: Could you perhaps provide a minimal example to reproduce this issue. This would help me to get down to the problem faster.


    Hey Krzysztof,

    I’ve just committed a patch that should fix the issues you are having. Could you perhaps give the latest snapshots of 3.2.1 a try?







    Just checked snapshot, it does work now, with ()+, etc. I only checked forum once and it’s already fixed. Very nice :) Thanks.

    Do you plan to support links like /#{param1}marker#{param2}, or there is no hope for me ;) and I have to split variables in my beans?




    This doesn’t work? I thought it did…



    Lincoln is right! This pattern should actually work. Could you give an concrete example that is not working?



    Oh, sorry for the confusion, it does work now. I did not check it after the last patch. My marker has commas and the link must have been broken because of that. How silly of me ;)

    Now everything seems to work ok. Thanks.



    Great! :)

Viewing 8 posts - 1 through 8 (of 8 total)

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

Comments are closed.