Search code examples
xpageslotus-domino

Read the incoming url after adding a redirection rule on server


I have added a redirection rule on the domino server like this:

Incoming URL pattern: /xxx/*
Replacement pattern: /myDb.nsf/myXpage.xsp

How is it possible from the xpage to read the incoming url in the browser?

If I open this url:

"http://myDomain/xxx/test"

Then I get redirected to my xpage and if I do context.getUrl() i got

"http://myDomain/myDb.nsf/myXpage.xsp"

but is there an option to read the incoming url?

"http://myDomain/xxx/test"

Solution

  • Ýou can change your replacement pattern to

    /myDb.nsf/myXpage.xsp/xxx/*
    

    This allows you to access the part between the .xsp and the query parameters with

    facesContext.getExternalContext().getRequestPathInfo()
    

    F.e.

    "http://myDomain/xxx/test"
    

    would give you

    "/xxx/test"