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?

