servletsurl-rewritingtuckey-urlrewrite-filter

URLrewritefilter(Tucky) error


I'm trying to rewrite url using tucky. Here is my rule.

<rule>
    <from>^/dev/([_A-Za-z0-9.@-]*)/([a-z.-]*)$</from>
    <to>webl?handler=developers&amp;userid=$1&amp;action=$2</to>
</rule>

Error details:

Context Path:/OPMS
Servlet Path:/dev/benjamin/webl
Path Info:null
Query String:handler=developers&userid=benjamin&action=webl

I'm clicking on this link from a page at /OPMS/webl. Why is $2 become "webl"? It is the name of my servlet. And also why they have servlet path: /dev/benjamin/webl?


Solution

  • the problem was not having a context path.

    <to context="WebAppName">/webl?handler=developers&amp;userid=$1&amp;action=$2</to>