Never mind. I found out how to do it. For anyone else interested, from a catalina.Request object you need to get the underlying coyote.Request object, access it's Scheme object (type MessageByte) and then set it's String value to "https".
I still don't understand why the catalina.Request object doesn't implement the convenience method setScheme(String) for this... Cheers, Matt. -----Original Message----- From: Matt Peterson [mailto:matt.peter...@une.edu.au] Sent: Monday, 14 June 2010 8:04 AM To: users@tomcat.apache.org Subject: Setting scheme on catalina Requests Using Tc 6.0.26, Java 6 on Win XP Pro. I am trying to develop a valve to modify requests based on a HTTP request header as set by our SSL terminating load balancer. The valve is to watch out for a particular header and when found, call the setSecure(true), setScheme("https") and setServerPort(443) methods so that the receiving servlet is aware that the request is a secure one. The setSecure() & setServerPort() methods work as expected, but the setScheme() method does not set the scheme. I have looked into the source for catalina.connector.Request and have found the setScheme() method is made of a single line: "// Not used". This would explain why the setScheme() method is not setting the scheme as I expect it would. So, how else could I set the scheme of the request to 'https'? There must be a way, because the http connector is able to set it if I use the 'scheme' attribute in the connectors XML config in server.xml. I have tried to find the code which does this, but have not been able to find it. Any help is ppreciated. Cheers, Matt. --------------------------------------------------------------------- To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org