protected int toPort(Object mappedValue) {
        String[] ports = (String[]) mappedValue;
        if (ports == null || ports.length == 0) {
            return getPort();
        }
        if (ports.length > 1) {
            throw new ConfigurationException("PortFilter can only be configured with a single port.  You have "
                    + "configured " + ports.length + ": " + StringUtils.toString(ports));
        }
        return Integer.parseInt(ports[0]);
    }
A Filter that requires the request to be on a specific port, and if not, redirects to the same URL on that port.
<p/>
Example config:
<pre>
[filters]
port.port = 80
<p/>
[urls]
/some/path/** = port
# override for just this path:
/another/path/** = port[8080]
</pre>

@since 1.0
web/src/main/java/org/apache/shiro/web/filter/authz/PortFilter.java