Matt RaibleMatt Raible is a Java Champion and Developer Advocate at Okta. developer.okta.com

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.

Invalid Reference to Login Page.

If you're using form-based authentication in your Tomcat Application - you might've seen this error before:

Apache Tomcat/4.0.4 - HTTP Status 400 - Invalid direct reference to form login page

type: Status report

message: Invalid direct reference to form login page

description: The request sent by the client was syntactically incorrect (Invalid direct reference to form login page).

Well, the good news is - I figured out how to get around this today. Basically, it's caused when someone tried to go directly to your <form-login-page> to login, rather than a protected resource.

I use my index.jsp (welcome-file-list) page to do a redirect to a projected resource:

index.jsp
--------
<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic" %>

<logic:redirect page="/do/mainMenu"/%gt;

So I merely added the error-page declaration below to my web.xml, and whalla - no more error message!

<error-page>
<!-- 400 code is from trying to go directly to login.jsp -->
    <error-code>400</error-code>
    <location>/index.jsp</location>
</error-page>

Posted in Java at Aug 28 2002, 06:07:51 AM MDT 5 Comments
Comments:

i also have the same problem of getting the error massege,, i have added the code <error-page> <!-- 400 code is from trying to go directly to login.jsp --> <error-code>400</error-code> <location>/index.jsp</location> </error-page> in my web.xml ,, but when i loggin with correct username and password i still get the same error page ,, i can,t figure it out ,, pls help

Posted by bug-bug on July 26, 2004 at 01:09 AM MDT #

If this doesn't help you - I don't know what will. You might try contacting support for your vendor's server. If it's Tomcat, I'd suggest contacting their mailing list.

Posted by Matt Raible on July 26, 2004 at 08:34 AM MDT #

OK guys, It is possible also to use this method for resolving our problem: To top login.jsp page you type: <% if(! session.isNew(){ session.sendRedirect("index.jsp") } %> Now you must to go web.xml file and type under login config(no important): <error-page> <error-code>400</error-code> <location>/index.jsp</location> </error-page>

Posted by vincenzo on January 12, 2007 at 03:57 AM MST #

I want to rectfier previous comment,because I have done a error to type the code line location. the location tag is followed: <location>login.jsp</location> Sorry Vincenzo

Posted by vincenzo on January 12, 2007 at 05:27 AM MST #

bla

Posted by 217.74.68.2 on May 21, 2008 at 04:25 AM MDT #

Post a Comment:
  • HTML Syntax: Allowed