daily dynamic url

Splash Forums Rewrite Users daily dynamic url

This topic contains 9 replies, has 3 voices, and was last updated by  arcturus 1 year, 5 months ago.

Viewing 10 posts - 1 through 10 (of 10 total)
  • Author
    Posts
  • #26875

    arcturus
    Participant

    Hiii guys.
    i’ve been wondering if i can rewrite my url dynamically, for example :
    today my url will be : http://www.domain.com/login/17/02/2015
    tomorrow : http://www.domain.com/login/18/02/2015

    in my code i’m writing something like : addRule(Join.path("/{page}").to("/views/{page}.xhtml"))

    #26876

    Sure.

    You can do that. I’m not sure what you want to do with the dates, but…

    .addRule(Join.path("/{page}").to("/views/{page}.xhtml"))
    .where("page").matches(".*").configuredBy(...)

    You might want to read the docs on parameterization, here: http://www.ocpsoft.org/rewrite/docs/configuration/parameters

    I hope this helps.

    ~Lincoln

    #26877

    arcturus
    Participant

    thnx for reply,
    1st of all i want to tell u that documentation of rewrite doesnt works with me.

    what i’m trying to do is to encrypte/decrypte url params

    • This reply was modified 1 year, 5 months ago by  arcturus.
    Attachments:
    1. UC
    #26879

    Could you give me more details about the documentation not working? I would love to fix it!

    I still need more information to help you. Rewrite can do anything you want, but I’m not really certain about what you want. From what I can tell so far, you just want to issue a redirect to a random page in the application. This can be done using the Servlet API, and a rule like I proposed above (and even the one you wrote) should work fine. So far your question doesn’t seem related to rewrite, rather how you can implement a particular feature in your application 🙂 So I’d like to help, but I need more info.

    Please provide (in addition to your current configuration and relevant code):

    1) The expected behavior.
    2) The behavior you are observing.

    Thanks,
    Lincoln

    #26881

    arcturus
    Participant

    please check attached file , its explain my use case

    • This reply was modified 1 year, 5 months ago by  arcturus.
    #26883

    arcturus
    Participant

    please check attached file, its describe my use case

    Attachments:
    1. cryptingUrl
    #26886

    arcturus
    Participant

    Hey, I’m trying to do something similar to this part of code :

    .addRule(Join.path("/private/{page}").to("/views/{page}.xhtml"))
    .where("page").convertedBy(new Converter<String>() {
            @Override
    	public String convert(Rewrite event,
    	EvaluationContext context, Object value) {
              // transform somethingcrypted to login
    	  return "login";
    }
    })

    so basically, if i call this url http://localhost/project/private/somethingcrypted. prettyfaces will get somethingcrypted param and transform it to the real name of page (for example login). finally, rewrite can find corresponding page login.xhtml

    i hope if this clear up my issue, please help…thnx in advance

    • This reply was modified 1 year, 5 months ago by  arcturus.
    #26889

    Basically the code looks good. Does it work if you hard-code the “login” value?

    #26890

    Yeah, that should work fine. You might also consider using a .transposedBy(Transposition x) instead of using a Converter. You might have to convert/transpose both ways “login -> 345678965” and “345678965 -> login” depending on inbound vs. outbound processing.

    #26908

    arcturus
    Participant

    Thnx both of u for reply.
    Mr @lincoln i tried what u said and its works fine 🙂
    thanks again for your help

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

You must be logged in to reply to this topic.

Comments are closed.