Meaningless Drivel is fun!
The moose likes Tomcat and the fly likes Switching btw 2 protocols Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Products » Tomcat
Bookmark "Switching btw 2 protocols" Watch "Switching btw 2 protocols" New topic

Switching btw 2 protocols

Hussein Baghdadi
clojure forum advocate

Joined: Nov 08, 2003
Posts: 3479

Hi all.
I know how to configure tomcat to use https protocol.
now, I want to develop the following application:
the user must type the following url to visit the application:
inside this page, I have the following link:
<a href="http://localhost:8443/context/register.jsp">Register</a>
the problem is :
how to configure tomcat to use https protocol (only) when the user clicks on register link (in this case , the port 8443).
I can make tomcat use https, but the problem is , it uses it for the whole
application ( I mean, https://localhost:8843/context/index.jsp)
which it is not the case in the real applications.
Any help is very appreciated..
Mike Curwen
Ranch Hand

Joined: Feb 20, 2001
Posts: 3695

are you configuring tomcat to 'use https' by setting transport-guarantee in web.xml for '/'?

That would result in requiring https for the 'whole' site, but you should be able to configure it on page-by-page basis.

Also, there's a much "simpler" way to do this, by simply modifying the link that takes you to the registration page. Make it :
<a href="https://localhost:8443/context/register.jsp">Register</a>

Then when that page is done, it can sendRedirect back to regular http:

I agree. Here's the link:
subject: Switching btw 2 protocols
It's not a secret anymore!