-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA256 Anil,
On 5/20/13 10:32 AM, Anil Goyal -X (anigoyal - Aricent Technologies at Cisco) wrote: > Hi All, > > I am adding a new service in tomcat with name "catalina_new" and > deploy an "abc" application under this. This application was in > running under catalina service previously. This new service is > using connector port 8181 for http and 8444 for https. Now I want > all my request coming for this application on port 8080 to redirect > on port 8181 for http ,8443 to redirect on port 8444. My tomcat > server.xml is using a valve class <Valve > className="com.cisco.unity.tomcat.valve.ConnectionRedirectValve" > redirectHost=""/> Some redirection logic is already written in this > valve class for some other application but that is only redirecting > the url with same port. if > (request.getContextPath().equals("/ciscopca") && > request.getRequestURI().startsWith("/ciscopca/unityinbox/")) { > response.setStatus(HttpServletResponse.SC_MOVED_TEMPORARILY); > response.sendRedirect("/inbox"); } > > How I can make a check here for request to redirect based on port > number. I think you are looking for HttpServletRequest.getServetPort(). You might find that url-rewrite is a better tool for you, as it's already been written and supports a huge number of options. http://tuckey.org/urlrewrite/ - -chris -----BEGIN PGP SIGNATURE----- Version: GnuPG/MacGPG2 v2.0.17 (Darwin) Comment: GPGTools - http://gpgtools.org Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/ iQIcBAEBCAAGBQJRm5ryAAoJEBzwKT+lPKRYXZwP/1XaADVRql3N15kVI4Pg8VoF R1KW930iz8D9Ul6YwqNOMN5XaF6mWSMJU7dgGzQ2T1wRyh5SAeYx1OUHxRp/5djO DT1mWhfIq8qivhvyRfn3Nf6FtpqfIGTf2P9PEUmle5lbUUwjODtx0XXNC4JgAhJo hvddNkFM/I+XzDNJbfEhPo5rCG1sT8tRv/kgOCgZ+OqX/QZP6m2SCBQBp6qeoj3c RK0HPZINUpl+dsnVE9BX8XAjMIRWUQoOTMB73Aq34OsmObryhaiDXl2/72YUpbhY Ds1xG58i/Y+tG4U6fNxVfIL7D88mYvOh/79fDuNwywZHWU3TIUj8FUJwdXlW49HC h7PYK6dWVVcYv61CvoX4g/+D2s4DxqO7BflBjsM42erflCVmZagFvDS38237iReR niTGUoPxnUZPGuvndJC7TvvstPfngaTQOygHcOyldQ7o3v3Wkzd4k+1Ao06W1ymH xQYT4k/AZkZjNqftPKiPhV7EwbePbpELyAhOrS1PWBN5lxCuzz1s06/6KE5qsBF3 fZFg86BTl/Dy9wGjlG6suL1Jb8S7ZvjzRpjTl+GSbb7HeX1ArDqrfkHX3lPVArKX 5FMi7qHosheaVBphV26W0ZkDczrJATGCm+FIyFqjTmPwhLvwp03YgTj5QZ/7fExT AH9kf5ceyKd6UEpEb+Mh =U20e -----END PGP SIGNATURE----- --------------------------------------------------------------------- To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org