hi,
I need some serious help in setting up JDBCRealm in tomcat...i tired for a full day without any success
<Realm
className="org.apache.catalina.realm.JDBCRealm"
debug="99"
driverName="com.mysql.jdbc.Drier"
connectionURL="jdbc:mysql://localhost/form"
connectionName="root"
connectionPassword=""
userTable="member"
userNameCol="username"
userCredCol="password"
userRoleTable="privilege"
roleNameCol="role" / >
Everytime I try to login it takes me to the error page....and the nothing comes out in the log
I have this web.xml configuration:
<security-constraint>
<web-resource-collection>
<web-resource-name>Protected Area</web-resource-name>
<url-pattern>/app/*
</url-pattern>
<http-method>GET</http-method>
<http-method>POST</http-method>
</web-resource-collection>
<auth-constraint>
<role-name>member</role-name>
</auth-constraint>
</security-constraint>
<login-config>
<auth-method>FORM</auth-method>
<realm-name>test realms</realm-name>
<form-login-config>
<form-login-page>/index1.jsp</form-login-page>
<form-error-page>/error.jsp</form-error-page>
</form-login-config>
</login-config>
<security-role>
<description>Memberss</description>
<role-name>member</role-name>
</security-role>
The mysql tables look like this
CREATE TABLE `member` (
`member_id` int(11) NOT NULL auto_increment,
`username` varchar(30) character set utf8 NOT NULL default '',
`password` varchar(80) character set utf8 collate utf8_bin NOT NULL default '',
`role` int(11) NOT NULL default '0',
PRIMARY KEY (`member_id`),
UNIQUE KEY `username` (`username`),
) ;
CREATE TABLE `privilege` (
`role_user` varchar(30) character set utf8 NOT NULL default '',
`role` varchar(30) character set utf8 NOT NULL default '',
PRIMARY KEY (`role_user`)
Yet, I can never access the database even with the data inserted is correct