File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Tomcat and the fly likes Redirect to https:// Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Products » Tomcat
Bookmark "Redirect to https://" Watch "Redirect to https://" New topic

Redirect to https://

Marty Finn

Joined: Aug 24, 2007
Posts: 7
If you remember a couple months ago, you guys help me setup an SSL certificate on our web server. Now I need a little more help. All works fine when we type in https://blah.blah.blah but it just comes back with a blank page and says done when we use http://

How can I redirect anyone that uses http:// to automatically change to https://

Tomcat 5.0 (Catalina)

[ October 01, 2007: Message edited by: Marty Finn ]
Paul Clapham

Joined: Oct 14, 2005
Posts: 18118

I use a servlet filter for that. But if you're having a problem with what you did, maybe we should try to fix that up.
Ben Souther

Joined: Dec 11, 2004
Posts: 13410

You can either do this programmatically with a filter, as Paul mentioned, or you can do it declaratively by adding a user-data-constraint entry in your deployment descriptor.

In this example, I've added the CONFIDENTIAL constraint to the tomcat/manager app:

Java API J2EE API Servlet Spec JSP Spec How to ask a question... Simple Servlet Examples jsonf
subject: Redirect to https://
Similar Threads
redirect URL using weblogic 9
Redirect a URL from http 9080 to https 9443
getRequestURL() returning only http instead of https?
SSL certificates for each one of the Tomcat Instances on single machine
Session is not preserverd whn sendRedirect is used ???