Pretty faces URl pattern case insensitivity

Splash Forums Rewrite Users Pretty faces URl pattern case insensitivity

This topic contains 8 replies, has 3 voices, and was last updated by  jvr 1 year, 2 months ago.

Viewing 9 posts - 1 through 9 (of 9 total)
  • Author
    Posts
  • #26393

    jvr
    Participant

    Hi, I am using pretty faces in my application and I have a requirement that I need to make my entire url pattern case insensitive.
    Is there any possible solution or approach to achieve this.

    for eg: http://localhost:8080/myproject/mypages/overview.

    my xml configuration:

    <url-mapping id=”overview”>
    <pattern> /mypages/overview </pattern>
    <view-id> /faces/layout/index.xhtml </view-id>
    <action phaseId=”RENDER_RESPONSE”> #{sub.prepareOverview} </action>
    </url-mapping>

    Even if i change the pattern to lower or upper case it should be redirected to the same page like
    http://localhost:8080/myproject/Mypages/Overview

    #26394

    Have a look here:

    http://ocpsoft.org/docs/prettyfaces/3.3.3/en-US/html/inbound_rewriting.html

    So something like this should work:

    <rewrite toCase="lowercase" redirect="301" />
    

    But this will rewrite ALL incoming URLs. You may need to further restrict the matching according to your requirements.

    #26410

    Shali123
    Participant

    I tried this but it is not working for me could you please provide me an example for this.

    • This reply was modified 1 year, 10 months ago by  Shali123.
    #26414

    This IS an example. 🙂

    Could you be more specific regarding “is not working”?

    #26415

    Shali123
    Participant

    I have added this <rewrite toCase=”lowercase” redirect=”301″ /> in pretty-config.xml file:

    My configuration:

    <url-mapping id=”overview”>
    <pattern> /mypages/overview </pattern>
    <view-id> /faces/layout/index.xhtml </view-id>
    <action phaseId=”RENDER_RESPONSE”> #{sub.prepareOverview} </action>
    <rewrite toCase=”lowercase” redirect=”301″/>
    </url-mapping>

    dependency:

    <dependency>
    <groupId>org.ocpsoft.rewrite</groupId>
    <artifactId>rewrite-servlet</artifactId>
    <version>2.0.12.Final</version>
    </dependency>
    <dependency>
    <groupId>org.ocpsoft.rewrite</groupId>
    <artifactId>rewrite-config-prettyfaces</artifactId>
    <version>2.0.12.Final</version>
    </dependency>

    Even after trying with Case insensitive it is not working.
    Could you please help where I made the mistake?

    #26416

    The <rewrite> element must not be placed inside the mapping. It’s a top level element in the configuration file.

    See:

    http://ocpsoft.org/docs/prettyfaces/3.3.3/en-US/html/GettingStarted.html#getstarted.prettyconfigxml

    #26420

    jvr
    Participant

    Is there any restriction with secure connection?

    #26426

    You mean SSL/TLS? PrettyFaces doesn’t know anything about SSL/TLS. That’s the job of the container.

    #27209

    jvr
    Participant

    With SSL.

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

You must be logged in to reply to this topic.

Comments are closed.