我有j_security_check的Java代码,可以在本地Tomcat + MySQL服务器上运行。我无法使用Openshift Jboss(Tomcat)盒式磁带。
---- web.xml代码片段:----
<security-constraint>
<web-resource-collection>
<web-resource-name>Validate</web-resource-name>
<url-pattern>/user/*</url-pattern>
<http-method>POST</http-method>
<http-method>GET</http-method>
</web-resource-collection>
<!-- Authorize the service and programmer roles -->
<auth-constraint>
<role-name>user</role-name>
</auth-constraint>
</security-constraint>
<!-- Use form-based authentication to provide access -->
<login-config>
<auth-method>FORM</auth-method>
<form-login-config>
<form-login-page>/validation/login.jsp</form-login-page>
<form-error-page>/validation/login_error.jsp</form-error-page>
</form-login-config>
-------- META-INF / context.xml中:-----
<Context path="/musicStoreOTUser">
<Resource auth="Container"
driverClassName="com.mysql.jdbc.Driver"
logAbandoned="true"
maxActive="100"
maxIdle="30"
maxWait="10000"
name="jdbc/musicDB"
password="ask4_sgh"
removeAbandoned="true"
removeAbandonedTimeout="60"
type="javax.sql.DataSource"
url="jdbc:mysql://127.7.245.2:3306/mydb"
username="admin1234"/>
<Realm className="org.apache.catalina.realm.JDBCRealm"
connectionName="admin1234"
connectionPassword="ask4_sgh"
connectionURL="jdbc:mysql://127.7.245.2:3306/mydb"
dataSourceName="jdbc/musicDB"
debug="99"
driverName="com.mysql.jdbc.Driver"
roleNameCol="Rolename"
userCredCol="Password"
userNameCol="EmailAddress"
userRoleTable="RoleTable"
userTable="PassTable"/>
当我在登录表单中登录时,我只是登录不正确。 jbossews.log文件中没有记录任何消息。
欣赏任何想法。
谢谢,