always getting redirected to error page?

dear everyone and all,

I had looked for some reference and had added these code to the web.xml.

<web-app>

<security-constraint>

<web-resource-collection>

<web-resource-name>MemberSite</web-resource-name>

<url-pattern>/member/*</url-pattern>

</web-resource-collection>

<auth-constraint>

<role-name>member</role-name>

</auth-constraint>

</security-constraint>

<login-config>

<auth-method>FORM</auth-method>

<form-login-config>

<form-login-page>/login.jsp</form-login-page>

<form-error-page>/error.jsp</form-error-page>

</form-login-config>

</login-config>

</web-app>

I needed to access the database to verify if the user had the right to access the web page. I had make the following table:

User Table

Have the fields like user_name, user_pass, user_role.

And I had added these code to server.xml.

<Context path="/book" docBase="book" debug="0">

<Realm className="org.apache.catalina.realm.JDBCRealm" debug="99"

driverName="com.mysql.jdbc.Driver"

connectionURL="jdbc:mysql://127.0.0.1/book"

userTable="user" userNameCol="user_name" userCredCol="user_pass" roleNameCol="user_role" />

</Context>

I had added these code to the xml files. But, it always redirect to the error page. Which steps I had missed so that I cannot use the j_security_check to login the web page?

[1614 byte] By [senthil_yogaa] at [2007-11-27 9:52:56]
# 1
I think that you have written bad Realm. First of all you forgot about connectionName and connectionPassword (used for connecting to database). You should also add userRoleTable attribute. Do you get any exceptions? error messages?Message was edited by: peter_07
peter_07a at 2007-7-13 0:22:01 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...