proposal for improvement: adjacent slashes

Splash Forums PrettyFaces Users proposal for improvement: adjacent slashes

This topic contains 2 replies, has 3 voices, and was last updated by  Christian Kaltepoth 6 years, 1 month ago.

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #18021

    0swald
    Participant

    Hi all.

    In some cases I keep uri parts as constants and reuse them in filters, other beans and mappings. While testing mapping inheritance I came across the situation where small improvement might be useful. Consider three mappings:

    @URLMapping(id="map1", pattern = "/test/", viewId="/x.xhtml")

    @URLMapping(id="map2", pattern = MyBean.URI_PART, viewId="/y.xhtml")

    @URLMapping(id="map3", pattern = MyBean.URI_PART, parentId = "map1", viewId="/z.xhtml")

    public class MyBean {
    public final static URI_PART = "/some/";
    }

    All works fine except the annoying adjacent slashes for third mapping which produces “/test//some/”. Regardless of my test case: I’ve never heard of someone that would intentionally use double (multiple) slashes in web design but I’m sure it’s not good from seo point of view. My low priority proposal is to create new filter config parameter which would trigger the removal of multiple slashes in url builder.

    #21318

    We could probably also just make sure that extra slashes are removed when building inherited patterns.

    This might cause *some* issues, but like you said, I don’t think people would intentionally do this, so it should be pretty safe.

    Thoughts?

    #21319

    I agree with Lincoln. I think it would be a good idea to ALWAYS prevent double slashes when building URLs using the mapping inheritance.

    @Oswald: Could you create a ticket for your suggestion?

    http://code.google.com/p/prettyfaces/issues/list

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

You must be logged in to reply to this topic.

Comments are closed.