Hello KC.

On Thu, 28 Feb 2002, KC Berg wrote:

> did you check your redirectPort in server.xml?
>
> ------------------------------
> <Connector className="org.apache.catalina.connector.http.HttpConnector"
>                port="8080" minProcessors="5" maxProcessors="20"
>                enableLookups="false" redirectPort="8443"
>                acceptCount="10" debug="0" connectionTimeout="60000"/>

 Yes. I'm just using the default settings:

    <!-- Define a non-SSL HTTP/1.1 Connector on port 8080 -->
    <Connector className="org.apache.catalina.connector.http.HttpConnector"
               port="8080" minProcessors="5" maxProcessors="75"
               enableLookups="true" redirectPort="8443"
               acceptCount="10" debug="0" connectionTimeout="60000"/>


> ------------------------------
>
> What I did to enforce the use of https and eliminate your issue was the
> following...
>
> ----------------------------------------
> if(request.getServerPort() != 443){
>   response.sendRedirect("https://"; + request.getServerName() +
> request.getServletPath()+"?"+ request.getQueryString());
>
> }
> -----------------------------------
>
> The above code works if you setup tomcat to use the standard ports for http
> and https. However you can use the above code in the following manner if you
> need to use the default tomcat ports.
>
> ----------------------------------------
>
> if(request.getScheme().equals("http")){
>   response.sendRedirect("https://"; + request.getServerName() + ":8443" +
> request.getServletPath()+"?"+ request.getQueryString());
>
> }
>
> ----------------------------------------
>
>
> I'm not sure if this is what you were after but it should work :)
>

 Maybe I'll try something like that. Thanks.


--
To unsubscribe:   <mailto:[EMAIL PROTECTED]>
For additional commands: <mailto:[EMAIL PROTECTED]>
Troubles with the list: <mailto:[EMAIL PROTECTED]>

Reply via email to