You need a proxy to do that. Because J2EE permits more than one webapp to be contained in a single server, the next level of the URL must tell which webapp to send the URL to. This is known as the application context There is a root context, which can handle URLs in the form http://server:port/pageurl, but that is not redirection and for many servers, there is already a default application located at the root context URL that must be removed before you can deploy your own application there.
Also, standard warning: user-login == hacked.
An IDE is no substitute for an Intelligent Developer.