How can I do for it using rewrite

Splash Forums Rewrite Users How can I do for it using rewrite

This topic contains 8 replies, has 4 voices, and was last updated by  Kalpana 9 years, 7 months ago.

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


    I want use rewrite to finish this work, how can I do?









    I want every page ends with .jsf to be shown ending with .html, and when request reached the server, it could be reversed.

    Thanks in advance.


    You can implement something like this using a Join. Have a look at this integration test here:

    So you could do something like this:

    .addRule( Join.path("/{name}.html").to("/{name}.jsf") );

    I hope this helps. :)




    Thanks for your reply.

    .addRule( Join.path("/{name}.html").to("/{name}.jsf") );

    I hava a question. Does the rule or Join rule do two things?

    first : Convert url /article.html?id=1 to /article.jsf?id=1 when client request, and then jsf lifecycle can process it

    second : If server redirect to login.jsf?expired=true, and it will rewrite to client as login.html?expired=true



    Short answer: yes! :)

    Long answer: A Join is actually a combination of two rules. An inbound rule which forwards incoming requests to the rewritten “internal” URL. And an outbound rule which rewrites URL generated by the server (redirects, URLs written to the response, etc.) to the externally visible URL.



    Thanks, it’s very clear! and I suggest you add this to examples of rewrite, then users can understand Join rule better.

    Where I can get the doc of user guide about it?

    I don’t know if Join rule can work with regex expression, Could it?



    .addRule( Join.path(“/{name}.html”).to(“/{name}.jsf”).where(“name”).matchs(“[a-zA-Z]+”) );



    Unfortunately there is currently no user guide and documentation. This is because we are still not 100% sure if the API won’t change anymore. We are still looking for feedback from the community.


    Yes, that’s the recommended way to do it. Thanks. :)



    Thanks for your replies, it’s very helpful.



    I am implementing rewrite in my project and want to have access to Rewrite documentation or API as that would be hepful

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

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

Comments are closed.