If you use tomcat with httpd, you can use RewriteEngine
.
With port specified is like the followings in the http.conf:
NameVirtualHost *:8443 #your specified port
ServerName www.example.com
Redirect permanent / https://secure.example.com/
See: RewriteHTTPToHTTPS and Redirect Request to SSL