aspose file tools*
The moose likes Servlets and the fly likes Switch back to HTTP after HTTPS page Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Servlets
Bookmark "Switch back to HTTP after HTTPS page" Watch "Switch back to HTTP after HTTPS page" New topic
Author

Switch back to HTTP after HTTPS page

Nick White Ro
Greenhorn

Joined: Jan 27, 2010
Posts: 15
I have 3 pages that send a user's password to the server, so I need them to be sent over SSL. So I declared them in the DD:



The problem is that, after I leave one of the pages (and I no longer need SSL), all the web app links are still pointing to the secure mode, so I can't switch back to "normal" mode:
* before: HTTP://<host>:8080/path
* after: HTTPS://<host>:8181/path

How can I solve this problem?
William Brogden
Author and all-around good cowpoke
Rancher

Joined: Mar 22, 2000
Posts: 12806
    
    5
When you create the links you will have to build in "http" - otherwise the browser assumption of https will continue.

Bill
Nick White Ro
Greenhorn

Joined: Jan 27, 2010
Posts: 15
Yes, but is there a way to build the links with full path without hard-coding the host name, the port and the app name?
Mark E Hansen
Ranch Hand

Joined: Apr 01, 2009
Posts: 645
Nick White Ro wrote:Yes, but is there a way to build the links with full path without hard-coding the host name, the port and the app name?

Yes. Have a look at the methods on the HttpServletRequest object (and it's super object, ServletRequest).
There are methods like getServerName(), getScheme(), getProtocol(), getLocalPort(), getServletPath() and so on.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Switch back to HTTP after HTTPS page