title: Tomcat: how to get the secure port number in Java?
body: <p>I'd like to embed a link to a secure page of my application in one of my unsecure pages.
  The secure tomcat port is configured in the server.xml file. In some deployments it's 443, 8443 etc.
  So what I need is a way to read the secure port from tomcat configuration to use it in the link. Is that possible?</p>
  
  <p>Alternatively, simply getting access to the server.xml configuration (from within the context of the request) and parsing it myself to figure out the port number is also acceptable, but less desired. </p>
  
  <p>I realize there could be several connectors, and several secure ones, so I'll leave it to my program's logic to decide which one to choose. Problem is - how do I get that info?</p>
  
  <p>Thanks!</p>