This week's book giveaway is in the Testing forum.
We're giving away four copies of Data Structures the Fun Way: An Amusing Adventure with Coffee-Filled Examples and have Jeremy Kubica on-line!
See this thread for details.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • Devaka Cooray
  • Ron McLeod
  • Jeanne Boyarsky
Sheriffs:
  • Liutauras Vilda
  • paul wheaton
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Piet Souris
  • Carey Brown
  • Tim Holloway
Bartenders:
  • Martijn Verburg
  • Frits Walraven
  • Himai Minh

Switch back to HTTP after HTTPS page

 
Greenhorn
Posts: 15
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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?
 
Author and all-around good cowpoke
Posts: 13078
6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Posts: 15
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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?
 
Ranch Hand
Posts: 650
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

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.
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic