On 31/08/2015 07:00, Sreyan Chakravarty wrote: > I don't understand where did I request the login page directly ? I just put > <form-login-config> as index.jsp and and the error page as > index.jsp?error=true. > > So where is my error ?
Did you request '/teacher/success.jsp' ? No, you did not. Did you request '/index.jsp' (or '/' that because of welcome page processing would forward to '/index.jsp') ? Yes, you did. And that is your error. Mark > > On Sun, Aug 30, 2015 at 9:54 PM, Mark Thomas <ma...@apache.org> wrote: > >> On 29/08/2015 22:16, Sreyan Chakravarty wrote: >>> Okay this is my first try at container based authentication using Realms >> in >>> Tomcat. And things have gone wrong. Here is my login page -: >> >> <snip/> >> >> >>> My web.xml security configuration is -: >>> >>> <security-constraint> >>> <web-resource-collection> >>> <web-resource-name>TECHERS</web-resource-name> >>> <url-pattern>/teacher/success.jsp</url-pattern> >>> <http-method>GET</http-method> >>> <http-method>POST</http-method> >>> </web-resource-collection> >> >> Remove the methods. By enumerating methods ONLY those methods are >> protected. PUT, HEAD, DELETE, etc. aould all be permitted. >> >> >> <snip/> >> >>> Now when I click on submit I get the following error page in Tomcat -: >>> >>> >>> *HTTP Status 400 - Invalid direct reference to form login page* >>> >>> *message* *Invalid direct reference to form login page* >>> >>> *description* *The request sent by the client was syntactically >> incorrect.* >>> >>> >>> Why is this happening ? Any help would be greatly appreciated. >> >> Because you requested the login page directly. You need to request the >> protected page and Tomcat will handle the redirects. >> >> Mark >> >> >> --------------------------------------------------------------------- >> To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org >> For additional commands, e-mail: users-h...@tomcat.apache.org >> >> > --------------------------------------------------------------------- To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org