File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes JSP and the fly likes how to redirect from https to http Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » JSP
Bookmark "how to redirect from https to http" Watch "how to redirect from https to http" New topic
Author

how to redirect from https to http

Jonh Smith
Ranch Hand

Joined: Mar 18, 2010
Posts: 39
Hello

I have a servlet protected with <transport-guarantee>CONFIDENTIAL</transport-guarantee>, which correctly makes glassfish generate an automatic redirection response to the https port, when i use that servlet's mapped url in the browser. However, once there, any redirection to some unprotected resource keeps using the htpps protocol, not http and i don't want that. How can i do a response.sendRedirect(/*WHAT DO I PUT HERE?*/) that acomplishes this ? That is, if i use



the server response redirect location is for
https://localhost:8082/mywebapp/myurl,

instead of
http://localhost:/8081/mywebapp/myurl

Thank you
Rohan kanade
Ranch Hand

Joined: Oct 22, 2009
Posts: 106


SCJP 1.6 ,SCWCD 5
Jonh Smith
Ranch Hand

Joined: Mar 18, 2010
Posts: 39
I wasn't very happy with hard-wiring the domain name so googled around and made a small change to your suggestion:

Thank you very much for your help!
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: how to redirect from https to http
 
Similar Threads
http to https redirect jboss 5.0.1 GA
Security Problem; 403 Forbidden Error
Tomcat filters
Tomcat SSL issue with "user-data-constraint"
Studying HeadFirst book: cannot make authentification