aspose file tools*
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
Author

Switching btw 2 protocols

Hussein Baghdadi
clojure forum advocate
Bartender

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:
http://localhost:8080/context/index.jsp
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:

Also:
http://www.javaworld.com/javaworld/jw-02-2002/jw-0215-ssl_p.html
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Switching btw 2 protocols