File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Tomcat and the fly likes Redirecting http to https imbedded Tomcat 4 Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Products » Tomcat
Bookmark "Redirecting http to https imbedded Tomcat 4" Watch "Redirecting http to https imbedded Tomcat 4" New topic

Redirecting http to https imbedded Tomcat 4

Dan Roberts

Joined: Jul 13, 2010
Posts: 1
I have an application that has a Web interface using an embeded Tomcat 4 Server. I need to make it available to users over the Internet and want to secure it with SSL. It originally worked on port 8080 but I successfully modified the SERVER.XML to make it work over port 80. I also sucessfully installed a public SSL Certificate from DigiCert and created an SSL connector so that if you specify you can access the app over SSL on port 443. The final piece of the puzzle I've been struggling with is automatically redirecting http: requests to https: All the Tomcat forums say this is pretty simple, all you need to do is add a bit of code to either the server or app's web.xml:



<web-resource-name>Protected Context</web-resource-name>







When I enter this code and restart Tomcat, the app stops working on all ports. I just get a '404' resource not found on the default page or any other. I'm sure I'm missing something but I have no idea what. Are there Any Tomcat gurus out there that can point me in the right direction?
I agree. Here's the link:
subject: Redirecting http to https imbedded Tomcat 4
It's not a secret anymore!