Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## org.acegisecurity.util
Class PortResolverImpl

    java.lang.Object
      org.acegisecurity.util.PortResolverImpl

All Implemented Interfaces:
  PortResolver, InitializingBean

    public class PortResolverImpl

extends Object
implements InitializingBean, PortResolver

Concrete implementation of `PortResolver` that obtains the port from `ServletRequest.getServerPort()`.

This class is capable of handling the IE bug which results in an incorrect URL being presented in the header subsequent to a redirect to a different scheme and port where the port is not a well-known number (ie 80 or 443). Handling involves detecting an incorrect response from `ServletRequest.getServerPort()` for the scheme (eg a HTTP request on 8443) and then determining the real server port (eg HTTP request is really on 8080). The map of valid ports is obtained from the configured `PortMapper`.

Version:
  $Id: PortResolverImpl.java,v 1.4 2005/11/17 00:56:09 benalex Exp $
Author:
  Ben Alex

Constructor Summary
`PortResolverImpl()`

Method Summary
`void` | `afterPropertiesSet()`
`PortMapper` | `getPortMapper()`
`int` | `getServerPort(javax.servlet.ServletRequest request)` Indicates the port the `ServletRequest` was received on.
`void` | `setPortMapper(PortMapper portMapper)`

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Constructor Detail

### PortResolverImpl

    public PortResolverImpl()

Method Detail

### setPortMapper

    public void setPortMapper(PortMapper portMapper)

### getPortMapper

    public PortMapper getPortMapper()

### getServerPort

    public int getServerPort(javax.servlet.ServletRequest request)

  Description copied from interface: `PortResolver`
  Indicates the port the `ServletRequest` was received on.

  Specified by:
    `getServerPort` in interface `PortResolver`
  Parameters:
    `request` - that the method should lookup the port for
  Returns:
    the port the request was received on

### afterPropertiesSet

    public void afterPropertiesSet()
                            throws Exception

  Specified by:
    `afterPropertiesSet` in interface `InitializingBean`
  Throws:
    `Exception`

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

Copyright © 2004-2005 Acegi Technology Pty Limited. All Rights Reserved.