File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Security and the fly likes Problem Using j_security_check Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Engineering » Security
Bookmark "Problem Using j_security_check" Watch "Problem Using j_security_check" New topic
Author

Problem Using j_security_check

Vikas
Ranch Hand

Joined: Dec 16, 2004
Posts: 63
Hello All,

I am trying to login to secured pages using j_security_check and JDBCRealm but when I try to login, the server displays me the following error message:-

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


Can anyone help me to fix this as I have tried alot to fix this but no results.
Chris Wagnor
Greenhorn

Joined: May 03, 2004
Posts: 21
Check whether the WEB.xml file has the correct mapping for the j_security_check. As I faced the same problem with Weblogic and fixed up using the same.

Make sure that your mapping is referring to the class in Apache. As this is the only way it can be solved.
Calin Lasting
Greenhorn

Joined: Feb 24, 2005
Posts: 1
Hy Shantanu,

About the subject here http://www.coderanch.com/t/133606/Security/security-check
how exactly has to be done the mapping configuration of j_security_check? Have you an example? What class must be associated? I tryed something like this but I still have the message "HTTP Status 400 - Invalid direct reference to form login page"

<filter>
<filter-name>LoginFilter</filter-name>
<display-name>PostLoginFilter</display-name>
<filter-class>com.x.webapp.LoginFilter</filter-class>
</filter>
<filter-mapping>
<filter-name>LoginFilter</filter-name>
<url-pattern>/j_security_check</url-pattern>
</filter-mapping>

After that I can successfully access a protected ressource.

Thanks.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Problem Using j_security_check