The port to which the container is bound is not controlled by the servlets. This is a configuration issue. It's also one that is greatly affected by the operating system. (i.e. On Unix systems, you would need to be root uer to bind to ports lower than 1025. You also can't have two applications bound to the same port/protocol combination).