PDA

View Full Version : Problem using Tomcat REALM to authenticate with Spring Framework


felipebb
Mar 23rd, 2006, 09:50 AM
Good morning you all! My name is Felipe, Iīm a software developer from Brazil, and Iīm beggining on Java WEB development. Right now, Iīm using Java 5.0, Tomcat 5.5.15 and Spring Framework 1.2.7, but I was used to use the Struts MVC.

In the beggining of my studies, I was trying to develop a simple web application hosted on Tomcat that use a controller to return me a view. Spring Framework granted it in less than 50 minutes, Itīs really a suberb framework.

But, one thing that I will have to use is some mechanism of user authentication and role access within application. Iīve already configured the REALM on Tomcat to work with Struts application, but, with Spring I canīt get it to work.

The problem is, when I try to access an protected content, The login page comes correctly. When I enter some bad login info, it sends me to the login error page, but, when I enter a correct login info, It shows me a page with the following info:



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).
Apache Tomcat/5.5.15



And there is something weird about it all:

When the login fails, the tomcat console shows the logging information saying that it could return the loging error view succesfully. But, when loging was supposed to happen, the tomcat console shows nothing, it donīt post info into the log archive.

Some will say: "Why donīt you use ACEGI??"

The learning curve is too high, and right now, I cannot loose time, thatīs why Iīm trying to give REALM a second chance.

Thanks a lot!