Win a copy of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) this week in the OCAJP forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

SSL in Tomcat

 
Rick Beaver
Ranch Hand
Posts: 464
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Ranchers

I am trying to enforce SSL on certain pages of my web application.

I am using Tomcat 4.something

I have SSL up and running fine but I have been unable to get the pages I want to only work in SSL to not be available on the normal http connection.

Lets say for example I wanted everything in /secure dir to use SSL exclusively how would I do that?

Cheers

Nick
 
Tim Baker
Ranch Hand
Posts: 541
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Here's one way you can do it without being tomcat specific.
In your JSP:
<% if (!request.isSecure())
{ %>
Sorry, this webpage is only available over a secure connection. (possibly provide a link to it?)
<% } %>
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic