Zero or more. This is very similar to a normal rule but it is used for rewriting urls that go through response.encodeURL().
response.encodeURL()
May contain "run", "from", "to" and "set" element(s) also. Example:
<outbound-rule> <from>^/world.jsp?country=([a-z]+)&city=([a-z]+)$</from> <to>/world/$1/$2</to> </outbound-rule>
Using the example above JSP's with the code <a href="<%= response.encodeURL("/world.jsp?country=usa&city=nyc") %>">nyc</a> will output <a href="/world/usa/nyc">nyc</a>
<a href="<%= response.encodeURL("/world.jsp?country=usa&city=nyc") %>">nyc</a>
<a href="/world/usa/nyc">nyc</a>
Or JSTL <a href="<c:url value="/world.jsp?country=${country}&city=${city}" />">nyc</a> will output <a href="/world/usa/nyc">nyc</a>
<a href="<c:url value="/world.jsp?country=${country}&city=${city}" />">nyc</a>
Note, If you are using JSTL (ie, <c:url) this will work also. URLREWRITE.XML
<?xml version="1.0" encoding="utf-8"?> <!DOCTYPE urlrewrite PUBLIC "-//tuckey.org//DTD UrlRewrite 3.1//EN" "http://tuckey.org/res/dtds/urlrewrite3.1.dtd"> <urlrewrite use-query-string="true"> <rule> <from>/show_([0-9]+)_([a-z]+).html</from> <to>/show.do?id=$1&data=$2</to> </rule> <outbound-rule> <from>/show.do\?id=([0-9]+)&data=([a-z]+)</from> <to>/show_$1_$2.html</to> </outbound-rule> </urlrewrite>
要冒一险!整个生命就是一场冒险,走得最远的人常是愿意去做、愿意去冒险的人。