Hi there,
I can't get the form based login-stuff working. I searched the Mailingslist,
but I found nothing that could help me.
First I have to say that the TC-example works... and THAT makes me dizzy :-)
my config:
TC4 RC2, using different CATALINA-HOME, Memory-Realm
server.xml
---------------------
<Engine ...>
...
<Realm className="org.apache.catalina.realm.MemoryRealm" />
...
<!-- perhaps important - using docBase="" -->
<Context path="" override="true" reloadable="false" cookies="false"
docBase="" debug="0"/>
</Engine>
---------------------
tomcat-users.xml
---------------------
<tomcat-users>
<user name="test" password="test" roles="admin" />
</tomcat-users>
---------------------
web-xml (in my webapp-home)
---------------------
<!-- protect admin stuff -->
<security-constraint>
<web-resource-collection>
<web-resource-name>admin</web-resource-name>
<url-pattern>/admin/*</url-pattern>
</web-resource-collection>
<auth-constraint>
<role-name>admin</role-name>
</auth-constraint>
</security-constraint>
<login-config>
<auth-method>FORM</auth-method>
<form-login-config>
<form-login-page>/admin/login.jsp</form-login-page>
<form-error-page>/admin/loginerror.jsp</form-error-page>
</form-login-config>
</login-config>
---------------------
To avoid any mistyping I simply copied the login.jsp from the examples. When
I try to access a protected resource like
http://localhost/admin/some.jsp then the login.jsp is called (but TWICE, I
realized this after I put a "System.out.println" into
the login.jsp). When I type admin/admin then the login-page is called again.
Whenever I type an obviously wrong username/password combination
the loginerror.jsp is called.
While trying everything, I got it "so far" that it redirected to
http://localhost/admin/null. But I don't know what I did to get there (but I
think I could reproduce this case when it's late at night again and I am
completely tired :-)
I strongly believe that this is simply misconfiguration and that my failure
is clear to see (just not for me :-)
If someone could enlight me on that?
sincerly,
pero