The richlet-mapping Element
From Documentation
Once a richlet is declared, you could map it to any number of URL by use of richlet-mapping as depicted below.
<richlet-mapping>
<richlet-name>Test</richlet-name>
<url-pattern>/test</url-pattern>
</richlet-mapping>
<richlet-mapping>
<richlet-name>Test</richlet-name>
<url-pattern>/some/more/*</url-pattern>
</richlet-mapping>
The URL specified in the url-pattern element must start with /. If the URI ends with /*, then it is matched to all request with the same prefix. To retrieve the real request, you can check the value returned by Page.getRequestPath() of the current page.
public void service(Page page) {
if ("/some/more/hi".equals(page.getRequestPath()) {
...
}
}
Version History
Version | Date | Content |
---|---|---|