Matt RaibleMatt Raible is a Web Developer and Java Champion. Connect with him on LinkedIn.

The Angular Mini-Book The Angular Mini-Book is a guide to getting started with Angular. You'll learn how to develop a bare-bones application, test it, and deploy it. Then you'll move on to adding Bootstrap, Angular Material, continuous integration, and authentication.

Spring Boot is a popular framework for building REST APIs. You'll learn how to integrate Angular with Spring Boot and use security best practices like HTTPS and a content security policy.

For book updates, follow @angular_book on Twitter.

The JHipster Mini-Book The JHipster Mini-Book is a guide to getting started with hip technologies today: Angular, Bootstrap, and Spring Boot. All of these frameworks are wrapped up in an easy-to-use project called JHipster.

This book shows you how to build an app with JHipster, and guides you through the plethora of tools, techniques and options you can use. Furthermore, it explains the UI and API building blocks so you understand the underpinnings of your great application.

For book updates, follow @jhipster-book on Twitter.

10+ YEARS


Over 10 years ago, I wrote my first blog post. Since then, I've authored books, had kids, traveled the world, found Trish and blogged about it all.

Forcing SSL on a JSP

I'm trying to replicate the behavior that occurs when you set CONFIDENTIAL to confidential in web.xml. If I do this, when I hit the index.jsp page of my webapp, I am automatically redirected to https://localhost/myappname. However, I have a different SSL port setup for testing, and I'd like to only switch on one page, the index.jsp page. So I've added the following scriplet to my index.jsp and it works great in Mozilla, but fails in IE. IE prompts me with the certificate information, and then gives a "Cannot Find Server" error. Any ideas?

<%
// TODO: Make this into a tag library
Boolean secureLogin = (Boolean)application.getAttribute(Constants.SECURE_LOGIN);
System.out.println("secureLogin: " + secureLogin);
if (secureLogin.booleanValue()) {
    // make sure we're using https
    if (request.getScheme().equals("http")) {
        String redirectString = SslUtil.getRedirectString(request,
                                                          application,
                                                          true);
        
        System.out.println("redirecting to: " + response.encodeRedirectURL(redirectString)); 
        %>
        <logic:redirect href="<%=response.encodeRedirectURL(redirectString)%>"/>                                                    
        <%
    }
}
%>

Everything looks the same in Tomcat's log when using either browser.

Posted in Java at Dec 10 2002, 10:10:25 AM MST Add a Comment
Comments:

Post a Comment:
  • HTML Syntax: Allowed