Use this method if you're using URL rewriting to create extensionless URLs. This method can intercept request routing and take action based on the extensionless path segments.
Note that this method depends on a rewrite rule being in place, and
wwProcess::UrlRewriteHandler getting fired by the rewrite rule.
Receives a loRewrite structure that contains the following properties:
A collection of segments between slashes of the URL.
The full original Url.
The logical path URL which is server relative and doesn't include the querystring
Determines whether this request was rewritten by IIS or other URL rewriter.
A single optional parameter that can be passed in. This is primarily to support JSON objects passed to
wwRestProcess so they can be passed through the UrlRewriteHandler() method that handles the method routing.
A typical implementation might look like this for urls like:
FUNCTION OnUrlRewrite(loRewrite, lvParm1) this.oRewrite = loRewrite *** Assume second segment is our method name IF loRewrite.oPathSegments.Count > 1 this.cRestMethod = loRewrite.oPathSegments.Item(2) IF VARTYPE(lvParm1) = "L" RETURN EVALUATE("THIS." + this.cRestMethod + "()") ELSE RETURN EVALUATE("THIS." + this.cRestMethod + "(lvParm1)") ENDIF ENDIF this.ErrorMsg("Invalid Route",; "Route values must at least include 1 segments relative to the virtual or root application") ENDFUNC
See also:Class wwProcess | wwUtils::CopyObjectProperties
Comment or report problem with topic