【发布时间】:2012-05-15 19:40:17
【问题描述】:
我在我的 struts web 项目中使用j_security_check,我将它部署在 jboss 中。
在我的web.xml 中,我定义了角色testuser,创建了一个包含users.properties 和roles.properties 的jar 文件,jar 名称为TestUserInfo.jar,其中Test 是应用程序的名称。
我的web.xml:
<security-constraint>
<display-name>To secure Test site</display-name>
<web-resource-collection>
<web-resource-name>test_actions</web-resource-name>
<url-pattern>*.action</url-pattern>
</web-resource-collection>
<auth-constraint>
<role-name>testuser</role-name>
</auth-constraint>
</security-constraint>
<login-config>
<auth-method>FORM</auth-method>
<realm-name>test offshore realm</realm-name>
<form-login-config>
<form-login-page>/login_form.jsp</form-login-page>
<form-error-page>/login_error.jsp</form-error-page>
</form-login-config>
</login-config>
<security-role>
<role-name>testuser</role-name>
</security-role>
users.properties 文件将 username=password 作为名称值对,roles.properties 将 username=role(在我的情况下为 user=testuser)作为名称值对。
当应用程序部署在 JBoss 中时,我可以使用 users.properties 文件中的用户名和密码登录。 TestUserInfo.jar 保留在 jboss-5.1.0.GA\jboss-5.1.0.GA\server\default\lib 下。
我必须在 websphere 中做什么才能实现相同的功能?
【问题讨论】:
标签: jakarta-ee websphere jboss5.x j-security-check